Most Commonly Used Git Commands

Here are some of the most commonly used Git commands:

  1. git init: Initializes a new Git repository in the current directory.
  2. git clone: Creates a copy of a remote repository in your local machine.
  3. git add: Adds changes to the staging area.
  4. git commit: Creates a new commit from changes in the staging area.
  5. git status: Shows the status of changes in the working directory and staging area.
  6. git log: Shows the commit history of the current branch.
  7. git diff: Shows the differences between two commits, or between the working directory and the last commit.
  8. git branch: Lists, creates, or deletes branches.
  9. git checkout: Switches to a different branch or commit.
  10. git merge: Combines changes from different branches into the current branch.
  11. git remote: Manages connections to remote repositories.
  12. git fetch: Downloads new changes from a remote repository, but doesn’t merge them.
  13. git pull: Downloads new changes from a remote repository and merges them into the current branch.
  14. git push: Uploads new commits to a remote repository.
  15. git stash: Temporarily stores changes that are not ready to be committed.

There are many other Git commands available, but these are some of the most frequently used ones.

Leave a Comment