So, you want to create a git branch with your current code
Fernando Tricas García

Fernando Tricas García @fernand0

About: El mundo es imperfecto. Puedes hacer algo para mejorarlo. O no. Puede que lo consigas. O no.

Location:
Zaragoza, Spain
Joined:
Mar 6, 2020

So, you want to create a git branch with your current code

Publish Date: Mar 15 '21
0 0

Just for my reference: you have a set of changes that are getting bigger and bigger but you do not want to commit them to the master branch for ... reasons. So you decide to create a new branch and you are not sure about what to do. You can check How To Create A GIT Branch With Your Current Changes or you can follow (more or less the following steps).

  • Create the new branch in place:

    git checkout -b newbranch

  • Commit the changes (add things if you need):

    git commit -am"Some useful message"

  • Push the changes if you feel so inclined:

    git push --set-upstream origin newbranch

You can also reset the master branch, if you want:

git branch -f master origin/master

Comments 0 total

    Add comment