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
相关推荐
老兵发新帖24 分钟前
软件开发国内常用镜像源配置及回退方法(MAC版)
macos·软件工程
qq_411262425 小时前
ESP32-C5 软件配置MAC 地址
macos
鸠摩智首席音效师5 小时前
如何在 MacOS 上安装 PostgreSQL ?
数据库·macos·postgresql
花千树-0106 小时前
IndexTTS2 在 macOS 性能最佳设置(M1/M2/M3/M4 全适用)
人工智能·深度学习·macos·ai·语音识别·ai编程
zhensherlock1 天前
Protocol Launcher 系列:Agenda 优雅组织你的想法与日程
javascript·macos·ios·typescript·node.js·mac·ipad
ipy2Tf8WP1 天前
全程用 Claude Code 搓了一个 macOS 原生应用:SkillDeck
macos
eLIN TECE1 天前
Mac安装Redis步骤
redis·macos·bootstrap
独隅1 天前
在 MacOS 上部署 Keras 模型的全面指南
人工智能·macos·keras
飞翔的SA2 天前
MLX‑VLM :Mac本地跑通多模态大模型的开源项目!让图片、音频、视频理解一键上手
人工智能·python·macos·音视频
sunfdf3 天前
移动硬盘上的文件消失了?以下是Mac电脑解决方法
macos·电脑