Common Git Commands


Git is a modern Source Control Management tool. It's wildly popular since it provides a mechanisms to broadly share and merge code bases.

This article lists the most common commands and by no means replaces the extensive documentation found here:


Configure Git

git config --global "wassamz"
git config --global ""

Set the remote repository origin

git remote add origin

Clone repository

git clone URL

Add file to local staging

git add <filenames>

Status of file changes

git status

Check for file differences

git diff

Commit change to local repository

git commit -m "descriptive commit message"

Push change to repository

git push -u origin master
git push

List all branches

git branch

Switch to a different branch

git checkout banch-name

Merge branch

git merge <branch name>

Delete branch on remote repository

git push --delete origin <branch name>

Delete branch in local repository

git branch --delete <branch name>

Git Source Control Management

Leave a Reply

Your email address will not be published. Required fields are marked *