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
相关推荐
穗余8 小时前
Mac 使用 Caps Lock 键切换输入法失灵问题解决
macos
寻道模式10 小时前
【时间之外】AI不懂Mac吗?
人工智能·macos
Qimooidea12 小时前
MacOS 平台 CAD 图纸翻译实战:从技术挑战到高效落地
macos·策略模式
一勺菠萝丶13 小时前
macOS 应用强制退出后无法再次启动:根因分析、排查方法与无重启恢复方
macos
秋雨梧桐叶落莳1 天前
iOS——NSUserDefaults学习
学习·macos·ios·objective-c·cocoa
8125035331 天前
第 5 篇:MAC 地址——IP 管远方,MAC 管眼前
macos
元Y亨H1 天前
Mac 办公效率进阶笔记
macos
元Y亨H1 天前
Mac 高级程序员配置笔记 (Java & Python 篇)
macos
元Y亨H1 天前
Mac 从入门到精通:效率进阶笔记
macos
开开心心loky1 天前
[OC 底层] (五) iOS 中常见的几种锁
macos·ios·cocoa