DEV Community

Liang Wang
Liang Wang

Posted on

git set up to track remote branch

I create a new branch locally, commit the code, now would like to push it to origin and track remote branch with the same name.

Example

create and check out new local branch called dev

git co -b dev

Enter fullscreen mode Exit fullscreen mode

set up to track remote branch 'dev' from 'origin'

git push -u origin dev
Enter fullscreen mode Exit fullscreen mode

git co is my alias for commit.

Top comments (0)