Home git How to create a new branch and upload changes

How to create a new branch and upload changes [duplicate]

Author

Date

Category

I cloned a remote repository with a project from the master branch, made a few changes, now I need to create a separate branch, push the changes into it, push these changes to the remote repository. How can this be done?

p.s. I was thrown on a project with git, but I never worked with it.


Answer 1, authority 100%

If you haven’t committed yet, then create a new branch branch_name

git checkout -b branch_name

Index your changes

git add.

Create a commit

git commit -m 'Comment on branch_name'

And push the changes to the remote server

git push origin branch_name

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions