SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ## Bring your current branch up-to-date with master, and squash all your working commits
  2.  
  3. ## commit any working changes on branch "${BRANCH}", then...
  4.  
  5. ## rename the branch to reflect it has the unsquashed commits
  6. git branch -m ${BRANCH}-unsquashed
  7.  
  8. ## crete a new local branch to start with the latest version of master
  9. git checkout master
  10. git checkout -b ${BRANCH}
  11.  
  12. ## squash in your working commits
  13. git merge --squash ${BRANCH)-unsquashed
  14.  
  15. ## commit the changes, opening your editor to provide a good commit message
  16. ## describing the work you were doing
  17. git commit -a
  18.  
  19. ## push the new branch to the your remote, force only if you've previously
  20. ## pushed some of the squashed commits and know you won't overwrite anyone's
  21. ## work
  22. git push --set-upstream ${REMOTE} ${BRANCH} --force
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top