Answer the question
In order to leave comments, you need to log in
How to create a branch and copy master to it?
Good evening.
I forked a project on GitHub and made some changes to it. A Pull Request was then created and is under consideration.
At this point, I want to start working on other changes. How can I create a new branch and clone the project's source code into it without the edits I just submitted?
Answer the question
In order to leave comments, you need to log in
I solved it by cloning the original project and changing its remote parameter .
Change to the branch you want to develop from:
git checkout master
Then create a new identical branch:
git checkout -b newbranch
You will immediately be on the desired branch.
git fetch origin
git checkout -b newbranch origin/master
how about reading the documentation? there is even in Russian !
If you have committed your edits to master and you need exactly the branch without your edits, you can checkout to origin
and then create a branchgit checkout -b newbranch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question