====== Git Cheat Sheet ====== These are the commands that I look up the most to make sure I'm doing them right. Eventually I'll remember them... ===== Branches ===== ==== Create a new branch from current changes ==== This will create the new branch. When the branch is created, it will be active with the changes from the old branch. Switching back to the old branch will no longer show the changes. $ git checkout -b ==== Create upstream branch from local branch ==== Commit any local changes then: $ git push -u origin ==== Delete a local branch ==== $ git branch -D Deleted branch (was ....). ==== Delete a remote branch ==== $ git push origin --delete To git@github.com:.git - [deleted] If someone already deleted the remote branch, synchronize your local branch list with: $ git fetch --prune ==== Merge ==== Merge branch into current branch $ git merge