← Back In the print window choose “Save as PDF” as the printer.

Git cheatsheet

Save every version of your code and never lose work

UnixDroid

How it works

  1. Initialise — git init turns a folder into a repository.
  2. Stage — git add chooses which changes go into the next save.
  3. Commit — git commit stores a snapshot with a message.
  4. Share — git push uploads your commits to GitHub or GitLab.

First steps

git init
Start a repository
git status
See what changed
git add . && git commit -m "first"
Save your changes
git log --oneline
Read the history
git switch -c new-idea
Create and move to a branch
Never commit passwords, API keys or private files. Add them to .gitignore, and change any secret that was committed by mistake. Practise only on your own computer, your own network or a lab that gives you permission. Using security tools on systems that are not yours can be a crime (in India under the IT Act).