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
相关推荐
2501_916007477 小时前
iOS 证书如何创建,从能生成到能长期使用
android·macos·ios·小程序·uni-app·cocoa·iphone
PeaceKeeper710 小时前
Objective-c的内存管理以及Block
开发语言·macos·objective-c
枉费红笺10 小时前
Linux / macOS 环境下解压 ZIP 文件的标准命令与常用变体
linux·运维·macos
逐梦苍穹10 小时前
为什么 AI 时代用 macOS 更好(以及如何少踩坑)
人工智能·macos
冰箱上的笑话11 小时前
Neovim 中文输入深度优化指南
macos·编辑器·vim·lazyvim
itwangyang52011 小时前
macOS(Sequoia 15.x)+ MacTeX 2025 + TeXShop + 期刊模板
java·开发语言·macos
wheeldown12 小时前
【Linux网络编程】网络基础之MAC地址与IP地址的区别
linux·运维·网络·macos
2501_9160074712 小时前
Xcode 在 iOS 上架中的定位,多工具组合
android·macos·ios·小程序·uni-app·iphone·xcode
2501_9151063213 小时前
iOS 抓包工具在不同场景的实际作用
android·macos·ios·小程序·uni-app·cocoa·iphone
神的孩子都在歌唱13 小时前
ARP 与 MAC 地址解析:局域网通信的第一步
网络·macos