GIT cheat sheet

Commands

Revert

1
2
3
4
5
# Revert changes to modified files.
$ git reset --hard

# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
$ git clean -fd

Add origin

1
2
3
4
git remote add origin ...

git push -u origin --all

Remove folder

1
git rm -r --cached path_to_your_folder/

Windows git credential manager

Git Credential Manager

Cleanup local branches

1
2
git remote prune origin --dry-run