git – pushing a new local branch to remote


There are a few things that I have to do regularly in “git”, but have a gap of a few weeks between each time I do them. This gap is just long enough me to not bother remembering them, so I find myself googling these things again and again – so here’s the first of my regular but infrequent things I have to do in git…

Pushing a new local branch to remote

git push -u origin local-branch-name

which should give something like this…

Counting objects: 71, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (36/36), done.
Writing objects: 100% (37/37), 530.39 KiB | 365 KiB/s, done.
Total 37 (delta 28), reused 0 (delta 0)
To ssh://nas2/dw_git/rpd_deploy.git
 * [new branch] local-branch-name -> local-branch-name
Branch local-branch-name set up to track remote branch local-branch-name from origin.