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
相关推荐
2501_9159184113 小时前
详解iOS App上架至App Store的全流程步骤与注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
库奇噜啦呼19 小时前
【iOS】weak底层实现
macos·ios·cocoa
2601_9615934220 小时前
视频分辨率太低?Topaz Video AI v1.6.0 让画质跃升
人工智能·macos·音视频
177155743121 小时前
Mac 上 Ruby、gem、rvm、CocoaPods 四者关系通俗讲清楚
macos·ruby·cocoapods
Shell运维手记21 小时前
交换机(二层交换机)完整工作原理
运维·网络·网络协议·macos·交换机
寒水馨1 天前
macOS下载、安装 Tailwind CSS-v4.3.3(附安装包tailwindcss-macos-arm64)
前端·css·macos·tailwind css·utility-first·css 框架·实用优先
寒水馨1 天前
macOS下载、安装neovim-v0.12.4(附安装包nvim-macos-arm64.tar.gz)
macos·vim·lua·文本编辑器·终端·lsp·neovim
库奇噜啦呼1 天前
【iOS】NSOperation与NSOperationQueue
macos·ios·cocoa
奶糖 肥晨2 天前
mac系统中Java项目环境配置与问题解决全记录|项目启动篇:从编译打包到生产级部署
java·开发语言·macos
a4493153622 天前
MacBook 转轴屏线断裂故障分析——eDP 排线更换与转轴维护
macos·电脑