diff --git a/knowledge base/git.md b/knowledge base/git.md index 82231a3..bfdebca 100644 --- a/knowledge base/git.md +++ b/knowledge base/git.md @@ -357,6 +357,13 @@ git show :/cool # Skip commit hooks. # Most useful with a broken `pre-commit` or `lefthook` executable or config. git commit --no-verify … + +# Reset fork to upstream's state +git remote add 'upstream' '/url/to/original/repo' +git fetch 'upstream' +git checkout 'master' +git reset --hard 'upstream/master' +git push 'origin' 'master' --force ``` ## Authentication @@ -1028,6 +1035,7 @@ git -c http.sslVerify=false … - [Dress up your git diffs with word-level highlights] - [Git global config for specific repositories?] - [cheat.sh] +- [Clean up a fork and restart it from the upstream]