see where are we
git branch
make sure we are up to date
git pull
create the branch and change to it
git branch new_branch_name
git checkout new_branch_name
git branch –m oldbranch newbranch
git push origin :oldbranch newbranch
git branch –-unset-upstream
The last command will delete the old branch and push the new one.
The ":" on the push will mark to delete the branch on the remote repo. Similar to using -d when deleting locally a branch.
git push origin :old-name-of-branch-on-github
git branch -m old-name-of-branch-on-github new-name-for-branch-you-want
git push origin new-name-for-branch-you-want
Check this for more information
http://www.w3docs.com/snippets/git/how-to-rename-git-local-and-remote-branches.html
git checkout branch_name
git fetch
git rebase origin/master
We have two branches, b1 has changes we want to merge in b2.
We put the repo in b2 and then merge the changes of b1.
Git checkout b2
Git fetch (optional)
Git merge b1
git branch -d branch_name