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
相关推荐
阿捏利5 小时前
详解Mach-O(十四)Mach-O __DATA
macos·ios·c/c++·mach-o
qinaoaini5 小时前
[golang][MAC]Go环境搭建+VsCode配置
vscode·macos·golang
追夢秋陽7 小时前
Cocoa 使用NSCollectionView显示列表,数据不足布局异常处理
macos·objective-c·cocoa·swift·collectionview
was1729 小时前
mac 下文件及文本命令行检索方案
macos·命令行工具·文本检索·文件检索
火车头-11011 小时前
MacBook Air M4 安装JvisualVM
spring boot·macos·visualvm
有趣的杰克12 小时前
macOS 实战:用 Swift + AppleScript 实现全局快捷键直达 ChatGPT / Claude / Gemini
macos·chatgpt
❀͜͡傀儡师12 小时前
macOS 镜像下载
macos
ELI_He99912 小时前
老macos安装openclaw固定brew版本
macos
xiaoliuliu1234512 小时前
MavenRunHelper.jar 使用步骤详解(附Maven命令执行与main方法运行)
macos
追夢秋陽1 天前
MacOS app打包Dmg线下分发测试及公证shell脚本
macos·shell·dmg·cocoa打包·打包脚本