Answer the question
In order to leave comments, you need to log in
How to cut commits from one branch to another?
Good day! There was a situation with which I can not cope alone.
There is a master branch in the repository. I need to move some commits from this branch to the new one. But so that they are removed from master.
Hope the community can help. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
git checkout -b "branch-name" "commit-hash"
branch-name - branch name
commit-hash - commit hash code from which to branch. All commits that were later will not go into the new branch.
Example:
git checkout -b "new-branch" "ffe5069daa6d42e4f9e0efc28892e5401d42183f"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question