mac gitee新建工程遇到的一些问题

首先,记录一下mac系统显示隐藏文件夹的快捷键:command+shift+句号,可以显示工程目录下的隐藏的git文件夹

一 git报错:'origin'does not appear to be a git repository的解决方法

找到工程目录下的.git/config文件发现里边没有remote origin的配置,手动填上去,如下:

bash 复制代码
[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[remote "origin"]
	url = 远程仓库地址
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

二 git报错fatal: 'origin' does not appear to be a git repository Could not read from remote repository

检查remote内容

bash 复制代码
git remote -v

删除远程origin

bash 复制代码
git remote rm origin

检查是否完全删除

bash 复制代码
git remote -v

重新建立连接

bash 复制代码
git remote add origin 远程仓库的地址

三 git报错fatal: refusing to merge unrelated histories

bash 复制代码
git merge master --allow-unrelated-histories
git pull --allow-unrelated-histories
git push origin master
相关推荐
江梦寻6 小时前
MacOS下Homebrew国内镜像加速指南(2025最新国内镜像加速)
开发语言·后端·python·macos·架构·策略模式
*Lisen6 小时前
重新安装解决mac vscode点击不能跳转问题
ide·vscode·macos
weixin_3875456414 小时前
如何把 Mac Finder 用得更顺手?——高效文件管理定制指南
macos
itme26817 小时前
解决cocos 2dx/creator2.4在ios18下openURL无法调用的问题
macos·objective-c·cocoa
qq_279456151 天前
CADisplayLink、NSTimer、GCD定时器
macos·objective-c·cocoa
RR13351 天前
macOS 升级 bash 到最新版本
macos
我在北京coding1 天前
Tableau for mac 驱动
macos
檀越剑指大厂1 天前
【高效开发工具系列】Blackmagic Disk Speed Test for Mac:专业硬盘测速工具
macos
阿福不是狗1 天前
Python使用总结之Mac安装docker并配置wechaty
python·macos·docker
gen_1 天前
mac环境下的python、pycharm和pip安装使用
python·macos·pycharm