Reputation: 21476
Let's suppose we have this history of commmits:
c0 <- c1 <- c2 <- c3 <- c4 (master)
how can I get this?
c0 <- c1 <- c2 <- c3 <- c4 (master)
^
|- c21 <- c22 (test)
This is, keep al the work done, but starting a new branch from a past point.
Thanks
Upvotes: 1
Views: 114
Reputation: 160833
You could do it with one line:
git checkout -b test c2
Or if you just want to create the new branch and without checkout:
git branch test c2
Upvotes: 4
Reputation: 18402
You can do a simple checkout :
git checkout c2
And then start your branch as usual :
git checkout -b test
Upvotes: 5