企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## 一、报错(add):Another git process semms to be running in this repository, e.g. an editor opened by ‘git commit’. Please make sure all processes are terminated then try again. If it still fails, a git process remove the file manually to continue… **解决方案**:进入项目文件夹下的 .git文件中(显示隐藏文件夹或rm .git/index.lock)删除index.lock文件即可。 ## 二、报错(checkout):error: cannot stat 'xxx': Permission denied **解决方案**:可以尝试 退出编辑器、浏览器、资源管理器等,然后再checkout ## 三、报错(push):! [rejected] master -> master (fetch first) **解决方案**:可强制push ~~~ git push -f ~~~ ## 四、The file will have its original line endings in your working directory. 这是因为文件中换行符的差别导致的。这个提示的意思是说:会把windows格式(CRLF)转换成Unix格式(LF),这些是转换文件格式的警告,不影响使用。 **解决方案**: ~~~ git rm -r --cached ./ git config core.autocrlf false git add ./ ~~~ > CRLF是Carriage-Return Line-Feed的缩写,意思是回车换行 ## 五、fatal: refusing to merge unrelated histories 在Github新建一个仓库,写了License,然后把本地一个写了很久仓库上传。 先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法pull 因为他们是两个不同的项目,要把两个不同的项目合并,git需要添加一句代码,在git pull, 这句代码是在git 2.9.2版本发生的,最新的版本需要添加--allow-unrelated-histories ``` $ git pull origin master --allow-unrelated-histories ```