Welcome to the Git Reference section! Below you will find a comprehensive list of Git commands and their descriptions. If you're looking for more detailed information or tutorials, check out our Git Tutorial.

Basic Commands

  • Clone: Clone a repository from a remote server.
    git clone <repository-url>
    
  • Initialize: Initialize a new Git repository.
    git init
    
  • Status: Show the status of your working directory.
    git status
    
  • Add: Add files to the staging area.
    git add <file>
    
  • Commit: Commit the staged changes to the repository.
    git commit -m "<commit-message>"
    
  • Push: Push your local repository to a remote server.
    git push
    
  • Pull: Pull changes from a remote repository.
    git pull
    

Branching

  • Create: Create a new branch.
    git branch <branch-name>
    
  • Checkout: Switch to a different branch.
    git checkout <branch-name>
    
  • Merge: Merge a branch into the current branch.
    git merge <branch-name>
    
  • Delete: Delete a branch.
    git branch -d <branch-name>
    

Tags

  • Create: Create a new tag.
    git tag <tag-name>
    
  • List: List all tags.
    git tag
    
  • Delete: Delete a tag.
    git tag -d <tag-name>
    

Miscellaneous

  • Reset: Reset the current branch to a specific commit.
    git reset --hard <commit-hash>
    
  • Checkout: Checkout a file or directory from the repository.
    git checkout <file>
    
  • Diff: Show the difference between two commits or between the current commit and the working directory.
    git diff <commit-hash>
    

For more information on Git, visit the Git Wikipedia page.

Git Logo