Skip to content

Getting up to date with master

snlongmore edited this page May 14, 2015 · 9 revisions

To get your local copy of "frontend" up to date, do the following:

  1. To clone for the first time:
$ git clone https://github.com/camelot-project/frontend.wiki.git
  1. Check that your remotes are set up correctly. Should look like this:
$ git remote -v

origin	[email protected]:adamginsburg/frontend.git (fetch)
origin	[email protected]:adamginsburg/frontend.git (push)
upstream	[email protected]:camelot-project/frontend.git (fetch)
upstream	[email protected]:camelot-project/frontend.git (push)
  1. Check what branch you're on:
$ git branch
  feature_branch
* master

If you only have one branch, that's OK, but any changes you make should go on a different branch when possible (see below). You should be on master now (there should be a * next to master)

  1. "Pull" the changes from master
$ git pull upstream master
From github.com:camelot-project/frontend
 * branch            master     -> FETCH_HEAD
Already up-to-date.

If you encounter a problem like "Your local changes to the following files would be overwritten...", you have options:

  1. Ditch them, completely removing all local changes. Be cautious about this! git reset --hard HEAD will reset all "tracked" files (those being stored by git) to the latest committed version.
  2. "Stash" them - put the changes aside for a moment so you can recover them later.
git stash
git pull upstream master
git stash pop

git stash makes a temporary commit, storing away all of your changes into a commit that's on a "stack" that you can later "pop" from.

If you get a different error, e.g. "The following untracked working tree files would be overwritten...", again you have two options:

  1. Ditch them - delete the files in question. Obviously, they will be lost.
  2. git add them and then git commit those changes.