eudaimonious
1/13/2014 - 6:16 PM

Merge and squash, stash alternative, delete branches, rebase

Merge and squash, stash alternative, delete branches, rebase

// 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>