-
-
Save eudaimonious/8405236 to your computer and use it in GitHub Desktop.
Merge and squash, stash alternative, delete branches, rebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Squash commits into a new branch before merging | |
git co staging && git pull | |
git co -b <similar topic name, e.g. topic-pr> | |
git merge --squash <original topic branch> | |
git add . | |
git commit -m "REP-123: Story title" | |
git push <similar topic name> | |
// Go to GitHub issue my pr | |
// Blow away stuff I haven't committed | |
git reset --hard | |
// Delete remote branches | |
git push origin --delete <branchName> | |
// Delete local branches that are no longer on github | |
git remote prune origin | |
// Squash all commits before pushing | |
git rebase -i <a sha of the commit before your last commit> | |
// change all but one 'pick' to 'squash' | |
git commit --amend -m "New commit message" | |
git push origin -f <branch name> | |
git rebase -i HEAD~<number of commits to squash> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment