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
相关推荐
出了名的洗发水5 小时前
mac设置共享文件,win用户也可以访问
macos
superbadguy5 小时前
Mac新手入坑
macos
我寄人间雪满头丶5 小时前
GitHub 私有仓库 SSH 访问配置 SOP(Mac / Windows 通用)
macos·ssh·github
2501_915918416 小时前
iOS App 测试方法,Xcode、TestFlight与克魔(KeyMob)等工具组合使用
android·macos·ios·小程序·uni-app·iphone·xcode
新手村领路人8 小时前
macos如何查看修改系统变量或用户变量
macos
旭日跑马踏云飞8 小时前
【本地玩AI】在macOS+AppleSilicon安装ComfyUI
人工智能·macos
旭日跑马踏云飞9 小时前
【向日葵】macOS连接windows时剪贴板不生效
macos
CrankZ9 小时前
[开源] 软软启动台 - 支持 Windows 和 macOS 的软件启动台(Launchpad)
macos
七夜zippoe10 小时前
Python多线程性能优化实战:突破GIL限制的高性能并发编程指南
python·macos·多线程·读写锁·gil·rcu
weixin_4624462311 小时前
使用 pip3 一键卸载当前环境中所有已安装的 Python 包(Linux / macOS / Windows)
linux·python·macos