Do you need to create a branch to check out a specific git revision?

后端 未结 4 647
孤独总比滥情好
孤独总比滥情好 2021-02-18 14:45

A common thing I\'d like to do is revert my working copy to a particular revision, do some testing, and then bring it back to the head of my current master. In the past I have

4条回答
  •  借酒劲吻你
    2021-02-18 15:20

    You can create a branch at the the specific commit you want to checkout (from the manual page)

    git branch [--set-upstream | --track | --no-track] [-l] [-f]  []
    

    so fill in the as the SHA1 you want you new branch to start at and you won't get your 'head' detached from an expanding branch.

    There will be other things you probably want to do to keep some of your working files in the state you desire....

提交回复
热议问题