These are some commonly used git
commands. Typing git <command> --help
in the terminal will provide more information about how to use the command <command>
.
Command | Description |
---|---|
status | Checks the status of a repository |
add | Add files/changes to the repository |
commit -m "message" | Commit (save) the current state of the directory with a message to summarise the changes |
push | Upload a repository to a git server (eg GitHub) |
pull | Download a repository from a git server |
clone | Create a local copy of an online repository on a computer |
log | See the history of commits |
diff <file> | Compare the current version of a file to its version in the last commit |
blame <file> | See a history of who edited a file |