Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top