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
相关推荐
秋雨梧桐叶落莳4 小时前
iOS——ZARA仿写项目
学习·macos·ios·objective-c·cocoa
2501_916007479 小时前
Xcode支持的编程语言、主要功能及使用指南
ide·vscode·macos·ios·个人开发·xcode·敏捷流程
分***811 小时前
MacOS苹果电脑下怎么打开md格式文件?超好用的macOS原生Markdown编辑器MiaoYan分享
macos·编辑器·macdown编辑器
qq_4572107111 小时前
Mac 上 Claude Code 完整安装使用指南(跳过登录注册)
macos
AI砖家11 小时前
DeepSeek TUI 保姆级安装配置全指南 -Windows||macOS双平台全覆盖
服务器·前端·人工智能·windows·macos·ai编程·策略模式
Java王小怪12 小时前
MacOs安装应用提示应用损坏
macos
iOS马家包处理12 小时前
超级右键Mac版本
macos
醉逍遥neo1 天前
mac新电脑-前端开发配置
前端·macos·ghostty
夏沫琅琊1 天前
Mac 安装cc-switch
macos
爱吃提升1 天前
Figma汉化包下载安装教程(FigmaEX集成版Mac安装教程)|版本区别+下载方法+详细步骤+新手入门指南
macos·figma