Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Git useful commands

GIT Useful commands

Keeping a clean git fork

git remote add upstream <git-url-project>
git fetch upstream
git merge --ff-only upstream/master
git pull --ff-only upstream master
git push origin master
git fetch --all


Fetching remote

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment