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
相关推荐
Benny的老巢8 小时前
Mac上用XAMPP搭建局域网可访问的开发环境,让局域网内其他设备通过域名访问
nginx·macos·apache·xampp·php开发环境
2501_9418814015 小时前
在墨西哥城复杂流量环境下构建高稳定性API网关的架构设计与实现实践分享
macos·golang·xcode
wadesir16 小时前
macOS Sequoia与macOS Tahoe全面对比:功能、性能与升级教程(新手入门指南)
macos
FreeBuf_19 小时前
新型TCC绕过漏洞:macOS面临自动化攻击风险
macos·自动化·策略模式
Alice19 小时前
Remote control Mac ios
macos
huaiyanchen19 小时前
mac Navicat 下载及安装
macos
人生何处不修行20 小时前
iOS 自定义视频播放器实战:全屏旋转 + 画中画(PiP)+ 多页面切换不中断播放
macos·objective-c·cocoa
梁辰兴1 天前
计算机网络基础:MAC 地址
计算机网络·macos·计算机·mac地址·计算机网络基础·梁辰兴·物理地址
酒书2 天前
mac电脑idea更改git用户名和密码
git·macos·intellij-idea
科技智驱2 天前
格式化数据分区会清除哪些数据?Windows/Mac如何正确格式化
windows·macos·电脑