Take a look at my Overview of Git States and Transitions article
Here's a bunch of things that I struggle to remember, or have struggled to remember in the past. Putting them here saves me from googling the same thing repeatedly.
git push --delete remote_name branch_name git branch -d branch_name ## Or if branch isn't merged: git branch -D branch_name
git fetch -p
I've sometimes had strange commit orders in my GitHub pull requests. This happens after reordering commits (eg using an interactive rebase).
Here are some ways to get the commits to be in a sensible order:
You can by using
pickwhen doing the rebase.
(I haven't tried this yet.) Apparently
git rebase –committer-date-is-author-datewill work if you have a non-buggy Git version.
(Git commits have both an author date and a committer date. I guess that when you pick a commit, the author date does not get changed.)