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
相关推荐
1telescope5 小时前
MacBook 安装 nvm 管理 Node.js 多版本教程
macos·node.js
1telescope6 小时前
MacBook 安装 Oh My Zsh 完整教程
macos·mac
蜜汁小强6 小时前
macOS 上的git代理配置在哪里
git·macos·代理模式·proxy模式
蜜汁小强7 小时前
macOS 上升级到 python 3.12
开发语言·python·macos
上天_去_做颗惺星 EVE_BLUE7 小时前
Android设备与Mac/Docker全连接指南:有线到无线的完整方案
android·linux·macos·adb·docker·容器·安卓
goodmao8 小时前
【macOS】【磁盘空间整理】查看大文件夹
macos
七夜zippoe8 小时前
Cython终极性能优化指南:从Python到C++的混合编程实战
c++·python·macos·cython·类型系统·内存视图
韦东东1 天前
万元级边缘算力方案:Mac Mini在几个知识库项目的部署实践
人工智能·macos·大模型·mac mini·边缘算力·知识库应用
小镇学者1 天前
【python】macos环境升级自己安装的python3
开发语言·python·macos
TESmart碲视1 天前
解锁多屏办公效率:2026年深度解析EDID技术与KVM切换器解决方案
macos·计算机外设·kvm切换器·tesmart·双屏kvm切换器·tesmart碲视