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
相关推荐
杂货铺的小掌柜8 小时前
MAC版IDEA常用快捷键
java·macos·intellij-idea
江下枫1 天前
macOS 内置反恶意软件三板斧
macos
昵称已被吞噬~‘(*@﹏@*)’~1 天前
【强化学习】MacOS (M1芯片)上最新版本 MuJoCo 通用安装教程(最简洁),PS:不是 mujoco_py 的老版本
python·macos·机器学习·强化学习·mujoco
小锋学长生活大爆炸1 天前
【教程】MacOS绕过Apple Develop ID获取麦克风权限
macos·swift
TESmart碲视2 天前
如何设置双屏KVM切换器(Win+Mac双屏双系统共享一套键鼠):手把手详细指南
macos·计算机外设·mst·kvm切换器·tesmart·双屏kvm切换器·tesmart碲视
2501_915106322 天前
iOS开发中CPU功耗监控的实现与工具使用
android·macos·ios·小程序·uni-app·cocoa·iphone
TheNextByte12 天前
如何使用数据线或无线方式将照片从Mac传输到 iPhone?
macos·ios·iphone
Data吴彦祖2 天前
Mac上安装Visual Studio Code教程
c语言·macos·visual studio code
芒鸽2 天前
macOS 上用 lycium 交叉编译 FFmpeg 适配鸿蒙(OHOS):从构建到 HNP 打包
macos·ffmpeg·harmonyos
禾叙_2 天前
【ollama】同一WiFi下Mac访问Windows Ollama失败?完整调试指南(从Connection refused到成功连通)
windows·macos