How to update to latest Sage without losing work

  1. Always make sure you’re working in a Git repo
  2. Make sure all your work is committed
  3. Add Sage as a remote git remote add upstream git@github.com:roots/sage.git
  4. Pull upstream changes git fetch upstream
  5. Rebase upstream changes into yours git rebase upstream/master
  6. Manually fix all conflicts (read: https://help.github.com/articles/resolving-merge-conflicts-after-a-git-rebase/ and http://tedfelix.com/software/git-conflict-resolution.html)

Note: if you just cloned Sage direct you can skip #3-5 and do these steps:

  1. git fetch
  2. git rebase origin/master

If you mess up the rebase process you can always reset your repo to the last good state/commit.

9 Likes