Sync Github fork repo with origin/master by makaroni4

E302c3320cd14b02cbe237b479d7f884?size=52

When contributing to open source you may face a problem – your fork is outdated. There could be another scenario – git repo in Github is just mirror of perforce repo, so after your pull request is merged there won't be your commits in repo and you again will have to sync fork and origin.

git remote add upstream git://github.com/username/repo.git
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force

#git

Git clone without history by releu

757fb0d5ec7560b6f25f5bd98eadc020?size=52

If you don't want to clone all #git repo, for example:

git clone git://github.com/rubinius/rubinius.git
Cloning into 'rubinius'...
remote: Counting objects: 226027, done.
remote: Compressing objects: 100% (55389/55389), done.
Receiving objects:  35% (79200/226027), 20.39 MiB | 32 KiB/s

More under the cut