Git Commands for Beginners

Git Commands for Beginners

With multiple people working on a software project, coordination sometimes becomes difficult. Git is a version control system (VCS) for tracking changes in computer files and coordinating work on these files. Given below are a few commands that can be commonly used while using the VCS.

Git Commands

  • Clone remote repo : git clone [repository-url]
  • Refresh repo for the latest from remote repo : git pull
  • List all branches : git branch -a
  • Switch branch : git checkout [branch-name]
  • Check the status for the current repository : git status
  • Add new files : git add filename
  • Browse past commit information : git log Browse past commit information by using the one line option : git log –oneline
  • Check-in changes : git commit -m “Message to commit this file or directory” [directory-or-filename]
  • Compare file with past version : git diff cf39cd1 filename
  • Reset current branch head (HEAD) to the specified state : git reset <paths>

I know who did what, when, and why. Git

Post Comments

Leave a Reply

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

You May Also Like