Zach's Mugspideyclick logo

GitHub

GitLab

Linkedin

Instagram

Youtube

SoundCloud

Email

Git Cheat Sheet

Git Cheat Sheet

Clone repository: git clone <repo url>

Check out branch: git checkout <branch>

Pull changes from remote: git pull

Stage current changes: git add .

Remove file from current commit: git rm <file>

Stage current in tracked files: git commit -a

Amend last commit: git commit --amend Don't amend pushed commits!

Discard all local changes: git reset --hard HEAD

Discard local changes to a file: git reset --hard HEAD <file>

Show current changes: git diff

Push changes to remote: git push

Keep your private data out of your projects

https://gitlab.com/snippets/1906783

What's the deal with Commit Messages?

https://chris.beams.io/posts/git-commit/