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
相关推荐
Mr_sun.13 小时前
IDEA——Mac版快捷键
java·macos·intellij-idea
npupengsir13 小时前
mac安装Pyspark并连接Mysql
数据库·mysql·macos
npupengsir19 小时前
mac相关命令
macos
Robinson-sir1 天前
VMware按照的MacOS升级后无法联网
macos
老菜鸟YDZ1 天前
二十多年前的苹果电源Power Mac G4 Mdd 电源接口
macos·接口定义·mdd·power mac g4·studio display·m2454·苹果电源
anthonyzhu2 天前
Mac本地部署deepseek
macos
LOLA44442 天前
解压包格式7z怎么解压?8种方法(Win/Mac/手机/网页端)
macos·软件需求
木兰不吃草2 天前
如何在 Mac 上下载安装仙剑游戏仙剑世界?可以通过IPA砸壳包安装非常简单
游戏·macos·ios·游戏程序·mac
LOLA44442 天前
给压缩文件加密码的5种方法(win/mac/手机/网页端)
macos·软件需求
轻口味2 天前
DeepSeek 部署中的常见问题及解决方案:Mac 场景实践指南
macos·deepseek