[問題]Git 提示fatal: remote origin already exists
1、先刪除遠(yuǎn)程 Git 倉庫
$ git remote rm origin
2、再添加遠(yuǎn)程 Git 倉庫
$ git remote add origin 遠(yuǎn)程倉庫
如果執(zhí)行 git remote rm origin 報錯的話,我們可以手動修改gitconfig文件的內(nèi)容
$ vi .git/config
把 [remote “origin”] 那一行刪掉就好了。
[問題]git如何解決failed to push some refs to git
出現(xiàn)錯誤的主要原因是github中的README.md文件不在本地代碼目錄中
可以通過如下命令進(jìn)行代碼合并
git pull --rebase origin master
再執(zhí)行語句 git push -u origin master即可
如果碰到.git/rebase-apply/patch:7290: trailing whitespace.這是要代碼規(guī)范,即代碼中不允許以空格結(jié)尾。
可以通過
crlf類:這主要是不同操作系統(tǒng)平臺的回車編碼不同導(dǎo)致空格結(jié)尾
git config core.autocrlf true
git config core.safecrlf true
[問題]git文件過大無法上傳解決
原因:http.postBuffer默認(rèn)上限為1M。
解決辦法:在git的配置里將http.postBuffer變量改大一些即可
500M(524288000)
git config --global http.postBuffer 524288000
以后又碰到問題,在補充.小白一枚,若有問題請指教指教,謝謝!