git錯(cuò)誤一覽

fatal: destination path ‘文件夾名’ git clone already exists and is not an empty directory

解決:如果這是克隆項(xiàng)目時(shí)報(bào)的錯(cuò)誤,那么請(qǐng)檢查工作目錄是否為空,如果不是,刪除目錄中的文件即可

fatal: remote origin already exists.

解決:

  1. git remote rm origin
  2. git remote add origin git@xxx.xxx.xxx.xxx:/git/xxx.git // 參見(jiàn):dengjianqiang2011的專(zhuān)欄
remote: fatal: Unable to create temporary file '/git/xxxx.git/./objects/pack/tmp
_pack_XXXXXX': Permission denied
fatal: sha1 file '' write error: Broken pipe
error: failed to push some refs to 'git@121.40.77.13:/git/xxxx.git'

解決:檢查服務(wù)端git項(xiàng)目的權(quán)限(chown -R git:git /git)
注意:在初始化裸倉(cāng)庫(kù)時(shí),切記不要用root權(quán)限,可以:sudo -u git git init --bare /git/test.git

Initialized empty Git repository in /root/web/.git/
/root/.ssh/config: line 1: Bad configuration option: ServerAlivelnterval
/root/.ssh/config: terminating, 1 bad configuration options
fatal: The remote end hung up unexpectedly

解決:錯(cuò)誤的配置項(xiàng),找到/root/.ssh/config,刪除錯(cuò)誤行,或者直接刪除文件

You asked me to pull without telling me which branch youwant to merge with, and 'branch.master.merge' 
inyour configuration file does not tell me, either. Pleasespecify which branch you want to use on the 
command line andtry again (e.g. 'git pull').See git-pull(1) for details.If you often merge with the same branch, 
you may want touse something like the following in your configuration file:    [branch "master"]    remote
 =merge =[remote ""]    url =fetch =See git-config(1) for details.

解決:這其實(shí)不是錯(cuò)誤,因?yàn)闆](méi)有pull前設(shè)置跟蹤分支,設(shè)置:git branch --set-upstream branchA origin/branchB

fatal: unable to access 'https://github.com/laradock/laradock.git/': error setting certificate verify locations:

解決
方法1:git config --global http.sslverify "false" // 不推薦
方法2:git config --system http.sslcainfo "C:\Program Files\path\to \git\bin\ca-bundle.crt" --replace-all*** // 在git的安裝位置找到ca-bundle.crt,然后更新ssl證書(shū)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • git常用命令 GIT常用命令備忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章閱讀 8,877評(píng)論 1 26
  • 本文作者陳云峰,轉(zhuǎn)載請(qǐng)注明。 這篇文章記錄個(gè)人常用的一些命令,和記不住的一些命令,轉(zhuǎn)載了并不斷更新。 Git官網(wǎng) ...
    陳云峰閱讀 2,919評(píng)論 0 24
  • 在國(guó)外有一臺(tái)給你提供ssh服務(wù)的主機(jī),你在國(guó)內(nèi)就可以用ssh通過(guò)主機(jī)代理上網(wǎng),這就是ssh。 一~ Windows...
    微齋閱讀 1,454評(píng)論 0 0
  • 做游戲Android上的游戲開(kāi)發(fā)也有一年多了,雖然沒(méi)有什么高深的見(jiàn)解,但就遇到的問(wèn)題及解決方案做下記錄 我們的游戲...
    大莊閱讀 3,699評(píng)論 0 1
  • 好久沒(méi)更新日記,看見(jiàn)的聽(tīng)見(jiàn)的東西很多,但每當(dāng)想動(dòng)筆又被拖延癥困擾,今天看到一個(gè)研究生師姐發(fā)的一些信息,又被別人的努...
    pinnocchio閱讀 306評(píng)論 0 0

友情鏈接更多精彩內(nèi)容