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 小时前
mac中git操作账号的删除
git·macos
sysin.org5 小时前
VMware ESXi 8.0U3b macOS Unlocker & OEM BIOS 2.7 集成网卡驱动和 NVMe 驱动 (集成驱动版)
macos·esxi·bios·unlocker·oem·2.7
yanling20235 小时前
Parallels Desktop 20 for Mac中文版发布了?会哪些新功能
macos·虚拟机·pd
不会敲代码的VanGogh5 小时前
【iOS】——应用启动流程
macos·ios·objective-c·cocoa
sysin.org7 小时前
VMware ESXi 7.0U3q macOS Unlocker 集成驱动版更新 OEM BIOS 2.7 支持 Windows Server 2025
windows·macos·esxi·bios·oem·网卡驱动·nvme驱动
GEEKVIP7 小时前
恢复已删除文件的可行方法,如何恢复已删除的文件
macos·智能手机·电脑·笔记本电脑·cocoa·iphone·ipad
tekin8 小时前
macos清理垃圾桶时提示 “操作无法完成,因为该项目正在使用中” 解决方法 , 强制清理mac废纸篓 方法
macos·强制删除·强制清理·mac废纸篓
黑果魏叔14 小时前
macOS Sequoia 正式版(24A335)黑苹果/Mac/虚拟机系统镜像
macos
tekin15 小时前
macos macport软件包管理工具 sudo port install xxx 安装的软件的路径 与 brew install xxx 软件安装路径总结
macos·brew·port·macport·port install·port软件包安装路径·brew软件包安装路径
Hellc00717 小时前
MacOS升级ruby版本
前端·macos·ruby