Skip to main content
Git Commands Reference
Toshi Dávila avatar
Written by Toshi Dávila
Updated today

Setting up and configuring

  • config
    Get and set repository or global options.

  • help
    Display help information about Git.

Getting and creating projects

  • init
    Create an empty Git repository or reinitialize an existing one.

  • clone
    Clone a repository into a new directory.

Basic snapshotting

  • add
    Add file contents to the index.

  • status
    Show the working tree status.

  • diff
    Show changes between commits, commit and working tree, etc.

  • commit
    Record changes to the repository.

  • reset
    Reset current HEAD to the specified state.

  • rm
    Remove files from the working tree and from the index.

  • mv
    Move or rename a file, directory, or symlink.

Branching and merging

  • branch
    List, create, or delete branches.

  • checkout
    Switch branches or restore working tree files.

  • merge
    Join together two or more development histories.

  • mergetool
    Run merge conflict resolution tools to resolve merge conflicts.

  • log
    Show commit logs.

  • stash
    Stash the changes in a dirty working directory.

  • tag
    Create, list, delete, or verify a tag object signed with GPG.

Sharing and updating projects

  • fetch
    Download objects and refs (branches and tags) from another repository.

  • pull
    Fetch from and integrate with another repository or local branch.

  • push
    Update remote refs (branches and tags) along with associated objects.

  • remote
    Manage a set of tracked repositories.

  • submodule
    Initialize, update, or inspect submodules.

Inspection and comparison

  • show
    Show various types of objects.

  • log
    Show commit logs.

  • diff
    Show changes between commits, commit and working tree, etc.

  • shortlog
    Summarize git log output.

  • describe
    Give an object a human-readable name based on an available ref.

Patching

  • apply
    Apply a patch to files and/or to the index.

  • cherry-pick
    Apply the changes introduced by some existing commits.

  • diff
    Show changes between commits, commit and working tree, etc.

  • rebase
    Reapply commits on top of another base tip.

  • revert
    Revert some existing commits.

Debugging

  • bisect
    Use binary search to find the commit that introduced a bug.

  • blame
    Show what revision and author last modified each line of a file.

  • grep
    Print lines matching a pattern.

Did this answer your question?