我正在編寫一個工具來將Bitbucket(支持Git和Mercurial)的所有存儲庫備份到本地計算機。如何使用Git * INTO *裸倉庫進行抽取/提取?
它已經工作了水銀,我在那裏做這樣的:
- 創建一個新的空倉庫,但不會在本地機器
(同樣喜歡一個bare
Git倉庫) - 在工作副本從遠程存儲庫拉到本地空的存儲庫中
現在我正在嘗試使用Git做同樣的事情。
I already found out我不能直接pull
到一個裸倉庫,我應該使用fetch
來代替。
所以我試了一下:
C:\test>git fetch https://github.com/SamSaffron/dapper-dot-net.git
remote: Counting objects: 1255, done.
remote: Compressing objects: 100% (1178/1178), done.
remote: Total 1255 (delta 593), reused 717 (delta 56)
Receiving objects: 100% (1255/1255), 13.66 MiB | 706 KiB/s, done.
Resolving deltas: 100% (593/593), done.
From https://github.com/SamSaffron/dapper-dot-net
* branch HEAD -> FETCH_HEAD
很明顯的Git 並取東西,但在那之後本地資源庫是空的。
(git log
說fatal: bad default revision 'HEAD'
)
我做錯了什麼?
免責聲明:
我只是非常,非常基本的Git知識(我通常使用水銀)。
而且我正在使用Windows,如果這很重要。
[git的日誌,並示出在裸回購]的可能重複(http://stackoverflow.com/questions/6214711/git-log-and-show-on-a-bare-repo) – CharlesB
@CharlesB :這個鏈接中的答案都不適用於我。甚至沒有像'git branch -va'這樣的提示工作,而不是建議的'git log branchname'(我嘗試'master'),也沒有「在存儲庫中可視化所有內容...」命令答案。 –