Git Commands and their uses

0

 Git is an open source , distributed version control to handle the projects . Git makes easier everything related the projects like changes to file , what change has been made etc. It is most popular collaborative system that modern IT companies uses . It provides the features of branches and merges .

In this article we will be seeing various Git commands that are used.



  1. git init - Creates a new git
  2. git clone - To clone a repository
  3. git status - It shows the state of current repository
  4. git log - It lists the commit history
  5. git diff - difference between the working directory and index.
  6. git show - It displays the content and metadata
  7. git branch - It lists all the branches in the repository
  8. git checkout [branch] - It switches to a branch
  9. git branch -d : It deletes a branch
  10. git branch -m : It renames the branch
  11. git merge [branch] : It merges the specified branch
  12. git add [file] : Stage changes
  13. git add : It stages everything
  14. git revert [file] : It does  undo the changes
  15. git clean -n : It shows the untracked files
  16. git commit --amend : It replaces the last commit
  17. git remote add : It establishes a connection to a remote reopsitory
  18. git pull : It fetches a repository
  19. git push : It pushes the branch
  20. git config --global user.name : It defines the author name which is to be used
  21. git reset : It resets the staging area to match most recent commit .
  22. git fetch <remote> <branch> : It fetches the a specific from the remote repository.


Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !