Can a local Git clone be considered a complete backup of the repo it was cloned from?

前端 未结 3 1801
小鲜肉
小鲜肉 2021-02-01 00:58

Suppose I have cloned a Git repository to my local disk using:

git clone username@git.example.com:someproject.git

Now suppose that git.ex

3条回答
  •  甜味超标
    2021-02-01 01:53

    Your local clone won't be a complete backup. It will be a backup of the state of that repository, but it won't have all the refs of the source repository (so it won't know about the state of any remote branches).

    For a complete backup, you correctly found git clone --mirror. This will not only have the branches for the original repository. It will also map all refs including remote branches.

提交回复
热议问题