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
相关推荐
马拉萨的春天40 分钟前
iOS中如果一个大图500M直接加载显示会崩溃,那么如何设置加载显示呢?
macos·ios·cocoa
AiXed2 小时前
PC微信WDA算法
前端·javascript·macos
刘晓倩11 小时前
Docker Desktop(Windows/Mac)零外网部署 Dify 极简指南
macos·docker·容器
gcygeeker16 小时前
解决 Mac 迁移数据后用户目录无权限问题
macos
todoitbo19 小时前
Rust新手第一课:Mac环境搭建踩坑记录
开发语言·macos·rust
熊猫在哪1 天前
macos安装mysql
数据库·mysql·macos
心灵宝贝1 天前
如何在 Mac 上安装 MySQL 8.0.20.dmg(从下载到使用全流程)
数据库·mysql·macos
denggun123452 天前
ios-WebP
macos·php·cocoa
Digitally2 天前
解决 iPhone 和 Mac 之间备忘录无法同步的9种方法
macos·ios·iphone
小妖同学学AI2 天前
Mac远程控制新篇章:UU远程被控端深度测评
macos·远程控制·uu