Skip to content

Git Cheat Sheet



Git is a popular version control system used by developers all over the world. It is a powerful tool that allows developers to track changes to their code and collaborate with others. However, with so many commands and options, it can be overwhelming. That’s why many developers use a Git cheat sheet to help them remember the most common commands and their syntax.

Basic Commands

The following are some of the most basic Git commands that every developer should know:

  • git init: Initializes a new Git repository.
  • git add: Adds changes to the staging area.
  • git commit: Commits changes to the repository.
  • git status: Shows the status of the repository.
  • git log: Shows the commit history.

Branching and Merging

One of the most powerful features of Git is its branching and merging capabilities. The following are some of the most important commands for branching and merging:

  • git branch: Lists all branches in the repository.
  • git checkout: Switches to a different branch or commit.
  • git merge: Merges changes from one branch into another.

Collaboration and Remote Repositories

Git is designed for collaboration, and it’s important to know how to work with remote repositories. The following are some of the most important commands for collaboration and remote repositories:

  • git clone: Copies a repository from a remote server.
  • git pull: Downloads changes from a remote repository.
  • git push: Uploads changes to a remote repository.
  • git remote: Lists all remote repositories.




  • gitlab version(
  • github version(

  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback, replace # with @