Answer the question
In order to leave comments, you need to log in
How to create a new branch with an old commit from master?
Hello! The question is - in the master branch there is a commit that I like more than the last one, but I don’t want to roll back to it in the master branch, but I want to create a new branch and unload this commit into it, and then work with it. however, I want both branches to be able to work in github pages. Can it be done? Well, or in one branch, but in a separate folder.
Answer the question
In order to leave comments, you need to log in
Create a new branch from the commit you need. At the same time, it will be the last one in the new branch and all previous commits will also be saved:
Create a branch and immediately switch to it
git checkout -b branch_name hash
Create a branch without switching
git branch branch_name hash
Where hash is the commit hash you need. You can specify both its full hash, and at least the first 4 characters.
PS I haven't dealt with GitHub Pages either.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question