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
相关推荐
2301_7943339113 分钟前
Docker Compose 运行 Milvus (Mac) 并与 python 连接测试
macos·docker·milvus
Sammyyyyy15 分钟前
macOS是开发的终极进化版吗?
开发语言·macos·开发工具
pop_xiaoli1 小时前
OC-单例模式
macos·objective-c·cocoa
Magnetic_h7 小时前
【iOS】block复习
笔记·macos·ios·objective-c·cocoa
栒U16 小时前
一文从零部署vLLM+qwen0.5b(mac本地版,不可以实操GPU单元)
人工智能·macos·vllm
Swift社区19 小时前
在企业内部分发 iOS App 时如何生成并使用 manifest.plist
macos·ios·cocoa
他们都不看好你,偏偏你最不争气1 天前
【iOS】 单例模式
macos·objective-c·cocoa
FreeBuf_1 天前
苹果用户速更新!macOS存严重漏洞,用户隐私数据面临泄露风险
macos
Thomas21431 天前
macos deepctr_torch虚拟环境配置
macos
wxl7812271 天前
MacOS 运行CosyVoice
macos·cosyvoice·语音自然