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
相关推荐
IS68310 小时前
视频文案提取技术全景:ASR vs OCR,哪种方案更适合你?
ide·macos·xcode
安且惜1 天前
Windows或mac支持本地抓包
windows·macos
做萤石二次开发的哈哈1 天前
开发者如何调用 ERTC iOS API 完成 SDK 初始化配置?
macos·objective-c·cocoa
AUV11071 天前
Mac 录屏自动缩放怎么设置才不乱跳:自动片段、固定区域与鼠标跟随调试
macos·计算机外设
程序员良辰2 天前
【Mac快速切换JDK】Mac 使用 Homebrew + jenv 快速切换 JDK 版本
java·开发语言·macos
coding4u2 天前
Mac 外接显示器完全指南:从插上线到调好每个参数
macos·计算机外设·文件管理·显示器·策略模式·quick look扩展
zhyf1192 天前
(Mac)Homebrew部署Obsidian+Claudian+Excalidraw
macos
chuan.bai2 天前
Java RAG 实战(第 3 篇):从交互式聊天到多轮上下文
java·人工智能·macos·ai
Chennn__2 天前
开源项目:Recorder — 本地离线 macOS 录音转文字(通用/课堂/雅思,可选 Ollama)
macos
AUV11072 天前
录系统声音用什么 Mac 录屏软件:双音源到成片的五层验收
macos