Basic Git command List – the simple guide


Clone an existing repository

Create a new local repository



View Changed files in your working directory

View Changes to tracked files

To Add all current changes to the next commit

To Add some changes in <file> to the next commit

Commit all local changes in tracked files

Commit previously staged changes

Change the last commit

Don‘t amend published commits!



Show all commits, starting with newest

Show changes over time for a specific file

Who changed what and when in <file>



List all existing branches

Switch HEAD branch

Create a new branch based

on your current HEAD

Create a new tracking branch based on a remote branch

Delete a local branch

Mark the current commit with a tag



List all currently configured remotes

Show information about a remote

Add new remote repository, named <remote>

Download all changes from <remote>,

but don‘t integrate into HEAD

Download changes and directly merge/integrate into HEAD

Publish local changes on a remote

Delete a branch on the remote

Publish your tag s



Merge <branch> into your current HEAD

Rebase your current HEAD onto <branch>

Don‘t rebase published commits!

Abort a rebase

Continue a rebase after resolving conflicts

Use your configured merge tool to

solve conflicts

Use your editor to manually solve conflicts and (after resolving) mark file as resolved


Discard all local changes in your working  directory

Discard local changes in a specific file

Revert a commit (by producing a new commit with contrary changes)

Reset your HEAD pointer to a previous commit and discard all changes since then

preserve all changes as unstaged changes

preserve uncommitted local changes

Partner Sites

  • Mark the current commit with a tag – very useful, I did not know about this variable.