Skip to content

Instantly share code, notes, and snippets.

@fahadsiddiqui
Last active May 30, 2019 07:35
Show Gist options
  • Save fahadsiddiqui/66d325c689b4b88abaab238922eacb4d to your computer and use it in GitHub Desktop.
Save fahadsiddiqui/66d325c689b4b88abaab238922eacb4d to your computer and use it in GitHub Desktop.
Important Git Commands
# cache password rather retyping if not using SSH key
git config --global credential.helper cache
# local revert head upto x (number of last commit)
git reset --hard HEAD~x
# take remote head to x (commit hash) and remove commits after x (commit hash)
git push origin +x:IM-213
# clear contents of stash stack (https://git-scm.com/docs/git-stash)
git stash clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment