I want to be able to do the following:
Create a local branch based on some other (remote or local) branch (via git branch or git checkout
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
Usage: just type gcb thuy/do-sth-kool with thuy/do-sth-kool is my new branch name.