Giacomo Lawrance Giacomo Lawrance - 12 days ago 5
Git Question

Making a branch from repo history?

I have a branch deep down in my repo, around 15 commits earlier. I'd like to make that into a branch. Any way I can do this?

Thanks.

Answer

Checkout the commit that you want to branch from then branch.

Get the commit hash from the log e.g. ab3213e

git checkout ab3213e
git checkout -b my_new_branch
Comments