GIT TOP Most Usefull Commands

GIT TOP Most Usefull Commands

Here, we have listed some most usefully git commands.

$ git init

Initialize a Local Git Repository

$ git add <file>

$ git add .

Add one or more files to staging area.

$ git status

Check the status of your current repository and list the files you have made changes.

$ git log

 Provides a list of all the commits made on your branch

$ git commit -m "commit messgae"

Commit changes to Index but not to the remote repository.

$ git push origin <branch name>

 Push the branch to the remote repository so that other can use it

$ git pull

 The git pull command fetches all the changes from a remote repository to a local repository

$ git clone

 The git clone Creates a Git Repository copy from a remote source

$ git diff

 View the changes you have made to the file

$git config -global "your_name"

 This command tells Git who you are by configuring the author name

$ git config -global <your_emailId>

 This command tells Git who you are by configuring the author email

$ git remote add origin <server>

 This Commands Connect your local repository to the remote server and add the server to be able to push changes to it

$ git branch <branch_name>

 The Git Branch Creates a new branch

$ git checkout <branch name>

 Using git checkout we can switch from one branch to another branch

$ git merge <branch name>

Using git Merge we can a branch into the active branch

Subscribe to our Newsletter

Stay up to date! Get all the latest posts delivered straight to your inbox.

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Leave a Comment