I have some commits on my master branch. I want to create another branch which includes just two first commits in masters branch.how can I do this ?
Asked
Active
Viewed 118 times
-2
-
2Possible duplicate of [Branch from a previous commit using git](https://stackoverflow.com/questions/2816715/branch-from-a-previous-commit-using-git) – alseether Nov 15 '17 at 07:36
-
1Possible duplicate of [How do I create a new git branch from an old commit?](https://stackoverflow.com/questions/7167645/how-do-i-create-a-new-git-branch-from-an-old-commit) – Tim Biegeleisen Nov 15 '17 at 07:41
-
@alseether Thank you for your reminder – Afsanefda Dec 18 '17 at 07:32
-
@TimBiegeleisen Thank you for your reminder – Afsanefda Dec 18 '17 at 07:33
1 Answers
1
Assume you have a repository like in the image below
If you want create the newbranch
at the a5d0f81
commit as shown in the image.
git checkout -b newbranch a5d0f81
should work as show in the picture.

Vincent
- 415
- 4
- 9