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
相关推荐
Digitally34 分钟前
如何将照片从POCO手机传输到Mac电脑
macos·智能手机·电脑
Sugobet9 小时前
【安卓][Mac/Windows】永久理论免费 无限ip代理池 - 适合临时快速作战
android·tcp/ip·macos·网络安全·渗透测试·ip代理池·接入点
光头才能变强9 小时前
mac安装pycharm
ide·macos·pycharm
归辞...18 小时前
「iOS」————SideTable
macos·ios·cocoa
你好龙卷风!!!18 小时前
mac 安装pytho3 和pipx
macos
最幸伏的人20 小时前
Mac电脑安装HomeBrew
macos·homebrew
光头才能变强1 天前
Mac安装WebStorm 2025版本
macos
阳光明媚sunny1 天前
Mac电脑基本功能快捷键
macos·电脑
一盏红烛,一杯烧酒1 天前
mac alfred实现翻译功能
macos·alfred
T0uken1 天前
【Mac】OrbStack:桌面端虚拟机配置与使用
macos