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.
解決:
- git remote rm origin
- 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ū)