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
相关推荐
REDcker6 小时前
macOS「系统数据」暴涨到 几百GB?一篇文章教你安全清理(含排查顺序)
macos
sysinside6 小时前
macOS Sequoia 15.7.2 (24G325) 正式版 ISO、IPSW、PKG 下载
macos·sequoia
只是有点小怂6 小时前
macOS 没有像 Windows 上的 MobaXterm 的工具
macos
小雨青年8 小时前
环境准备 Windows Mac 下 Docker Desktop 的安装与镜像源加速
windows·macos·docker
数据知道8 小时前
一文掌握 MongoDB 详细安装与配置(Windows / Linux / macOS 全平台)
linux·数据库·windows·mongodb·macos
知1而N8 小时前
电脑上运行APK文件(Android应用程序包),需要借助特定的软件或功能,因为Windows/macOS/Linux系统无法原生直接运行安卓应用
android·macos·电脑
island13148 小时前
Mac 用户久等了!节点小宝 4.0 macOS版,正式登陆!
macos
440资源库8 小时前
从 Windows 转向 macOS:数据迁移完整指南
windows·macos·win向maos迁移数据
Lii78 小时前
Mac OS 26/15动态屏幕保护程序/壁纸路径地址
macos