How to create a new branch on both local and remote? GIT [duplicate]

First, you create your branch locally:

git checkout -b <branch-name>

The remote branch is automatically created when you push it to the remote server. So when you feel ready for it, you can just do:

git push <remote-name> <branch-name>

Where <remote-name> is typically origin, the name which git gives to the remote you cloned from. Your colleagues would then just pull that branch, and it’s automatically created locally.

Credit: this answer is a copy of https://stackoverflow.com/a/1519032

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)