DEV Community

Cover image for Most Used Git Commands
Yessine Agrebi
Yessine Agrebi

Posted on

Most Used Git Commands

What is Git ?

Git is one of the most popular Version Control Systems. It is a crucial part of daily programming.
In this article you will find the most used commands that every developer should know.

Git Clone

GIT CLONE :For downloading an existing project

git clone <https://name-of-repository-link>

Git Branch

Give the ability to work in parallel on the same project.

  • git branch : New branch
  • git push -u : Push the modification into the branch
  • git branch -list : List all the branches
  • git branch -d : Delete the branch
  • git checkout : Switch to new branch (create it if doesn't exist)
  • git status : Give the necessary informations about the current branch.

Git add / commit / push / pull / revert

  • git add : Include changes to the next commit
  • git commit -m "commit-message": Used to save modification under a commit with generated id.
  • git push : Used to send the updated or the new branch to the remote branch.
  • *git pull *: Used to update from the remote repository
  • git revert : Used to undo the modification related to specific commit.

Git merge

git merge :Used to merge the current branch with the
parent branch, with these steps :

  1. git checkout : go to a specific branch.
  2. git fetch : Update the specific branch
  3. git merge : Merging

Tips :the best place to get more details about
Git is documentation on the official website.
It is advised to work with Git via the Git bash
terminal . Every command mentioned up can
be used with many tags.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.