Common Git Commands

Git is predominately used through its command line interface (CLI). This means Git operates using a variety of different commands (and even sub-commands, command options for commands). Some of the most commonly used commands and their purpose:

CommandDescription
initInitialise a repository
cloneClone repository from remote host at URL
checkoutCheckout to branch or commit
branchCreate branch
addAdd files to commit stage
commitCommit staged changes
mergeMerge changes from another branch into current branch
pushPush changes to remote repository
pullPull changes from remote repository
fetchPull changes from remote repository without integrating changes into local repository
rebaseReapply commits on top of new branch HEAD
statusList the currently modified files and status of remotes
tagCreate or list a tag at the current HEAD

There are many more commands within Git's CLI. You can view them and their functionality using Git's Manpage. To access the Manpage run the following commands.

man git