Skip to content

Instantly share code, notes, and snippets.

@maoosi
Last active April 13, 2016 04:45
Show Gist options
  • Save maoosi/ee61ca2eb5f225e0a4c1879e6962af1f to your computer and use it in GitHub Desktop.
Save maoosi/ee61ca2eb5f225e0a4c1879e6962af1f to your computer and use it in GitHub Desktop.
Some useful git commands.
# Reset local repo to the last commit
git reset --hard
# Reset local repo to a specified commit
git reset --hard <SOME-COMMIT>
# Check last commit on your local
git log -1
# Get remote url used on your local
git config --get remote.origin.url
# Remove a file or folder from a repo, without deleting it from your local
git rm --cached mylogfile.log
git rm --cached -r mydirectory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment