Vijayan
Vijayan Thanks for stopping by guys! I'm Vijayan and Techpulse is my beloved brainchild. Currently working as a PHP developer in a digital marketing start-up, I'm overly passionate about not just learning new things but also putting those into practice. I swear by a quote I once came across... 'What separates successful people from unsuccessful people is the former's ability to execute'. Feel free to reach out to me if you have any questions, suggestions or feedback. Hoping to see more of you here!

Git commands for beginners


Git commands for beginners

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

Clone remote repo

1
git clone [repository-url]

Refresh repo for the latest from remote repo

1
git pull

List all branches

1
git branch -a

Switch branch

1
git checkout [branch-name]

Check the status of the current repository

1
git status

Add new files

1
git add filename

Browse past commit information

1
git log

Browse past commit information by using the one line option:

1
git log --online

Check-in changes

1
git commit -m "Message to commit this file or directory" [directory-or-filename]

Compare file with past revision

1
git diff cf39cd1 filename

Reset current branch head (HEAD) to the specified state

1
git reset <paths>

comments powered by Disqus