Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pull update from original repo

Cleanup local and reset to upstram master http://stackoverflow.com/questions/9646167/clean-up-a-fork-and-restart-it-from-the-upstream

git remote add upstream /url/to/original repo that you forked
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 

Syncing the fork by keeping local changes https://help.github.com/articles/syncing-a-fork/

git fetch upstream
git checkout master
git merge upstream/master
git push origin master

Squeeze all intermediate commits into single commit https://github.com/todotxt/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit

git rebase -i HEAD~4 # 4 commits
git commit --amend
git push origin branch-name --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment