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
相关推荐
Ceelog2 小时前
MemoryBubble(内存泡泡) 戳泡泡清理 Mac 内存
macos·mac
扑火的小飞蛾10 小时前
【macOS】n8n 安装配置笔记
笔记·macos
TO_ZRG11 小时前
iOS 符号表文件概要
macos·ios·cocoa
默默在路上12 小时前
M芯片使用VMware Fusion安装CentOS Stream 9教程
linux·macos·centos
TheNextByte112 小时前
如何在Mac上收发Android信息 [2026 指南]
android·macos
耘田12 小时前
 macOS Launch Agent 定时任务实践指南
java·开发语言·macos
不爱吃糖的程序媛12 小时前
macOS 系统本地安装 openJiuwen 完整指南
macos
William.csj12 小时前
Mac——一款支持跨平台的与服务器之间的远程传输工具 FileZilla
macos·filezilla
Nightmare0041 天前
Mac打开终端
macos
亚里随笔1 天前
vscode mac常用技巧—快捷键
ide·vscode·macos