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
相关推荐
goodmao5 小时前
【macOS】【mouse】设置鼠标大小
macos·计算机外设·鼠标·mouse
Magnum Lehar6 小时前
macos信息采集器appledataharvester-3
macos·网络安全·系统安全
川川菜鸟8 小时前
Claude Code 安装与配置完整指南(Mac)
macos
WarmSword8 小时前
mac上用cursor/vscode调试root权限进程
c++·ide·vscode·macos·mac
Magnum Lehar9 小时前
macos的信息采集器appledataHarvester-2
macos·网络安全·系统安全
echo-niuben10 小时前
macOS 端已如何正常安装并配置XcodeBuildMCP ?
macos
刘某某.11 小时前
Mac上缺失宋体字体,只有宋体-简
macos
Tom·Ge12 小时前
在macOS上安装OpenClaw并实现Chrome网站自动化测试
chrome·macos·策略模式
Lo-Y-eH13 小时前
Mac 安装 Ollama 部署 DeepSeek 模型
macos·ollama·deepseek·cherry studio
仙剑魔尊重楼1 天前
iMazing 3.1.3官方中文版新功能介绍
macos·objective-c·cocoa