Basic Git Commands You Should Know


Dealing with Git about the control line could be daunting. To assist with this, we have compiled a listing of common Git controls, exactly what each means, and also how to use them. Our expectation is that makes Git simpler to work with on a daily basis.

Git has lots of excellent customers that let you utilize Git with no control line. Being aware of what activities the customer is doing at the history is advantageous to knowing how Git functions. If you are having started with Git check out our excellent guide about the subject .

This tutorial provides a list of the most common GIT commands, a short description for them and example usage. For a detailed description of all the GIT commands please check this page.



Working with local repositories

Git taskNotesGit commands
Check out a repositorycheckout code on local system git clone /path/to/repository
Add filesAfter working we need to add filesgit add <filename>
  git add *
CommitCommit changes to local system git head git commit -m “Commit message”
 Submit any records you’ve included with git , also we have commit any file we have change before.git commit -a
PushSend local changes to remote repository git push origin master
Statuscheck status your changes and commitgit remote add origin <server>
Connect to a remote repositoryshow all configured remote repositories listgit remote -v
BranchesCreate a new branch and move thare git checkout -b
 Move from one branch to any other branch git checkout <branchname>
 show working branch git branch
 Erase the element branchgit branch -d <branchname>
Update from the remote repositoryFetch and merge changes on the remote repository git pull
 To merge one branch to another branchgit merge <branchname>
 To check any file diffrance remote and server side git diff
  git diff –base <filename>
git logTo check your last commit all information git log
Undo local changesTo remove your local changes commit , and fetch the latest history from the servergit fetch origin
  git reset –hard origin/master

By – Sameer khare

Basic Git Commands You Should Know

Post navigation