Why Isn't There A Git Clone Specific Commit Option?

前端 未结 4 2027
一向
一向 2020-12-02 17:25

In light of a recent question on SO, I am wondering why isn\'t there an option in git clone such that the HEAD pointer of the newly created branch will point to

4条回答
  •  情话喂你
    2020-12-02 18:10

    If your specific commit is referenced by a branch, you can do a:

    git clone -b yourBranch /url/of/the/repo
    

    The cloned repo will be directly at the commit referenced by that branch.

提交回复
热议问题