Question

I cloned a git repository from a git server.

I want First to create a new branch locally (in my local code). and then I want to make smoe changes on the code and then make somme local commit.

And then I want to commit the new local branch and the local commits to the git server.

How to do that?

Was it helpful?

Solution

I want First to create a new branch locally (in my local code)

  • git checkout -b your-new-branch

And then I want to make some changes on the code and then make somme local commit.

  • git add . (if you want to include all your changes in the commit)

Or

  • git add each-file-separately

    git commit -m "Your commit message"

And then I want to commit the new local branch and the local commits to the git server

  • git push -u origin your-branch

Also, these are all super basic git commands and I strongly recommend reading the Pro Git Book to understand how it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top