A
A
Alexander Bagirov2016-03-19 20:32:29
git
Alexander Bagirov, 2016-03-19 20:32:29

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

4 answer(s)
A
Alexander Bagirov, 2016-03-20
@alexbagirov

I solved it by cloning the original project and changing its remote parameter .

D
Denis Zagaevsky, 2016-03-19
@zagayevskiy

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.

A
aol-nnov, 2016-03-19
@aol-nnov

git fetch origin
git checkout -b newbranch origin/master
how about reading the documentation? there is even in Russian !

Z
Zakhar Orlov, 2016-03-19
@divalign

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 branch
git checkout -b newbranch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question