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 task Notes Git commands
Check out a repository checkout code on local system git clone /path/to/repository
Add files After working we need to add files git add <filename>
    git add *
Commit Commit 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
Push Send local changes to remote repository git push origin master
Status check status your changes and commit git remote add origin <server>
Connect to a remote repository show all configured remote repositories list git remote -v
Branches Create 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 branch git branch -d <branchname>
Update from the remote repository Fetch and merge changes on the remote repository git pull
  To merge one branch to another branch git merge <branchname>
  To check any file diffrance remote and server side git diff
    git diff –base <filename>
git log To check your last commit all information git log
Undo local changes To remove your local changes commit , and fetch the latest history from the server git fetch origin
    git reset –hard origin/master

By – Sameer khare

Basic Git Commands You Should Know

Post navigation


3 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x