Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

git
communitycreator

How to create a branch in git from a specific commit id

Anjana Shankar

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

As a programmer, each one of us has worked with branches in Git. Sometimes, you will want to go back to a commit that was done previously or you may want to create a branch from a previous commit.

You can do this using the following command:

git branch branch_name <commit_sha>

You can check the logs and copy the commit id at which you want to create the branch. An example of this is shown below:

git branch anjana d0a9ba

RELATED TAGS

git
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring