如果我們往一個非空的目錄下 clone Git 項目,就會提示錯誤信息:
fatal: destination path '.' already exists and is not an empty directory.
解決的辦法是:
- 進入非空目錄,假設是 /workdir/proj1
- git clone --no-checkout git clone --no-checkout https://git.oschina.net/user/proj.git tmp
- mv tmp/.git . #將 tmp 目錄下的 .git 目錄移到當前目錄
- rmdir tmp
- git reset --hard HEAD
然后就可以進行各種正常操作了。
轉自:http://www.oschina.Net/question/54100_167919?sort=time