How to switch back to 'master' with git?

前端 未结 5 717
无人共我
无人共我 2021-01-30 02:43

I have made my first commit; then created a branch (let\'s say branch1).

In this branch I\'ve created a directory \'example\' and commited. In GitHub I see my new branch

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 03:13

    Will take you to the master branch.

    git checkout master

    To switch to other branches do (ignore the square brackets, it's just for emphasis purposes)

    git checkout [the name of the branch you want to switch to]

    To create a new branch use the -b like this (ignore the square brackets, it's just for emphasis purposes)

    git checkout -b [the name of the branch you want to create]

提交回复
热议问题