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
相关推荐
栗子叶2 小时前
IP协议 地址划分&MAC地址作用&ip addr命令
网络·tcp/ip·macos
draking5 小时前
Anthropic 封杀当天,我把 OpenCode 升到 1.1.11,踩了 5 个坑
macos·ai编程
Roye_ack6 小时前
【Mac环境配置教程】深度学习环境配置(Anaconda + PyTorch)
macos
程序员雄杰7 小时前
腾讯云轻量应用服务器mac中ssh免密登录到服务器
macos·ssh·腾讯云
YongPagani1 天前
Mac安装Homebrew
macos
Byron Loong1 天前
【系统】Mac系统和Linux 指令对比
linux·macos·策略模式
软件小滔1 天前
拖拽出来的专业感
经验分享·macos·mac·应用推荐
coooliang1 天前
Macos下载元神 ipa文件
macos
Benny的老巢1 天前
【n8n工作流入门02】macOS安装n8n保姆级教程:Homebrew与npm两种方式详解
macos·npm·node.js·n8n·n8n工作流·homwbrew·n8n安装
望眼欲穿的程序猿1 天前
基于Linux&MacOS 开发Ai8051U
linux·运维·macos