4/12/2016 - 1:22 AM

Some useful git commands.

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