essentially like cloning on github's servers - but that's inconsequential, mostly.. also: forks are not automatically up to date (relative to repo you forked)! your fork creates a snapshot of the original repo at the time you fork it.
-
fork on github
-
creates a clone on github servers
-
copy url of that clone
-
git clone [url]
- clones the content of your fork to your local machine
-
git remote add upstream [email protected]:flatiron-school/003-ruby-lectures
[or whatever the repo url is]- adds remote repo to your local
-
git fetch upstream
- adds new changes from original repo to your local machine.
-
git merge upstream/master
- (while in local master, assuming there have been changes on the original)
-
git push origin master
- pushes to your github fork, not original repo
-
submit pull request to original repo when you'd like to attempt to get your work integrated into original repo
using diff
to comapre changes between local and upstream:
git diff upstream/master master | subl
- where
upstream/master
is the remote (original),master
is your local master branch and| subl
sends the result to a sublime file instead of to the terminal output. - reverse the order of
upstream master
andmaster
to see the diff from the "opposite point of view", so to speak. Meaning, adds will look like removes and vice-versa [I haven't yet figured out the better way to approach this] - this
git diff
can also be used with your own remote repo (origin/master
vsupstream/master
)
- where