Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Bring your current branch up-to-date with master, and squash all your working commits
- ## commit any working changes on branch "${BRANCH}", then...
- ## rename the branch to reflect it has the unsquashed commits
- git branch -m ${BRANCH}-unsquashed
- ## crete a new local branch to start with the latest version of master
- git checkout master
- git checkout -b ${BRANCH}
- ## squash in your working commits
- git merge --squash ${BRANCH)-unsquashed
- ## commit the changes, opening your editor to provide a good commit message
- ## describing the work you were doing
- git commit -a
- ## push the new branch to the your remote, force only if you've previously
- ## pushed some of the squashed commits and know you won't overwrite anyone's
- ## work
- git push --set-upstream ${REMOTE} ${BRANCH} --force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement