Merging one branch into another branch
Start by checking out the destination branch.
$ git checkout [branch_name]
$ git pull
Merge the feature branch into the destination branch.
$ git merge [feature_branch]
Create a brand new branch
Before creating a new branch, checkout the branch you would like to copy from and pull the changes from upstream. Your master (or whatever) needs to be up to date.
$ git checkout [main_branch]
$ git pull
Create the new branch on your local machine and switch to this new branch.
$ git checkout -b [name_of_new_branch]
The first time you try to push the new branch, set the remote as upstream.
$ git push --set-upstream origin [name_of_new_branch]
See your last commit
Sometimes you want to see what you just committed.
$ git show --name-status