atlaschiew / git-study

happy giting
0 stars 0 forks source link

how do I create a remote Git branch? #16

Open atlaschiew opened 1 year ago

atlaschiew commented 1 year ago

First, create a new local branch and check it out:

git checkout -b <branch-name>

The remote branch is automatically created when you push it to the remote server:

git push <remote-name> <branch-name> 
is typically origin, which is the name which git gives to the remote you cloned from. Your colleagues may then simply pull that branch. Note however that formally, the format is: ```sh git push : ``` But when you omit one, it assumes both branch names are the same. Having said this, as a word of caution, do not make the critical mistake of specifying only : (with the colon), or the remote branch will be deleted!