Goutham Daneti Goutham Daneti - 1 year ago 72
Git Question

how can create a new branch from already existing commits?

I have branch which contains three commits. Now I want to create three new branches of these three commits, each commit should be separate branch, how can I achieve this?

Answer Source

About git branches

Reading the question and the comments (from the OP), I believe there is confusion about what a branch is, in git. A branch is simply a little sticky note pointing to a commit. Branches are not a "heavy" object in git, so you do not really "create new branches with those commits", nor does it make sense to say that "each commit should be a different branch"; you just label one commit "mybranch1", the other commit "mybranch2" and so on. The commands have been given by @TimBiegeleisen (git branch <name> <commit>).

Reading a little primer on how git structures its data may help. http://gitready.com/beginner/2009/02/17/how-git-stores-your-data.html

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download