How do I push a new local branch to a remote Git repository and track …

I made an alias so that whenever I create a new branch, it will push and track the remote branch accordingly. I put following chunk into the .bash_profile file: # Create a new branch, push to origin and track that remote branch publishBranch() { git checkout -b $1 git push -u origin $1 } alias gcb=publishBranch

Read More