Skip to content

Instantly share code, notes, and snippets.

@subhodi
Last active November 22, 2018 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subhodi/89619d575ac35a7a4e78f6a7ac705f7e to your computer and use it in GitHub Desktop.
Save subhodi/89619d575ac35a7a4e78f6a7ac705f7e to your computer and use it in GitHub Desktop.
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