2

Possible Duplicate:
branch from a previous commit using git

Can we create a branch from a previous commit? From the example below, can I create a branch from f70c700 (we're already at fabdd09 at this point):

$ git log --oneline --graph
*   fabdd09 Merge branch 'mybranch'
|\  
| * bd35011 Edit from mybranch
* | f70c700 Edit from master
|/  
* a2ff940 Initial submission.

Thanks.

Community
  • 1
  • 1
moey
  • 9,619
  • 20
  • 64
  • 109

1 Answers1

2

This is as easy as:

git branch my-new-branch f70c700

... or if you want to create the branch and switch to it in one command, you can do:

git checkout -b my-new-branch f70c700
Mark Longair
  • 385,867
  • 66
  • 394
  • 320