[@naukriengineering] git basic commands and hacks

12
GIT commands Rashi Atry (Naukri Quality)

Upload: naukricom

Post on 21-Jan-2017

103 views

Category:

Engineering


4 download

TRANSCRIPT

Page 1: [@NaukriEngineering] Git Basic Commands and Hacks

GIT commands

Rashi Atry

(Naukri Quality)

Page 2: [@NaukriEngineering] Git Basic Commands and Hacks

WHAT IS GIT?

Page 3: [@NaukriEngineering] Git Basic Commands and Hacks

How do You use Git?

via Tools/ extensions OR command line?

Page 4: [@NaukriEngineering] Git Basic Commands and Hacks

Basic Commands

git clone <.git url>

git checkout

git status

git branch

git add

git pull

git commit

git push

git stash

Page 5: [@NaukriEngineering] Git Basic Commands and Hacks

git checkout

git checkout

git checkout <branchName>

git checkout –b <newBranchName>

git checkout <fileName>

Page 6: [@NaukriEngineering] Git Basic Commands and Hacks

git add

git add

git add –p

git add –p <fileName>

Page 7: [@NaukriEngineering] Git Basic Commands and Hacks

git stash

git stash

git stash save

git stash list

git stash apply

git stash drop

git stash -p

Page 8: [@NaukriEngineering] Git Basic Commands and Hacks

git reset

git reset - -hard HEAD

git reset - - soft <any point hash>

Page 9: [@NaukriEngineering] Git Basic Commands and Hacks

More Commands

git commit –m <commitMessage>

git branch –m <newBranchName>

git push origin <nameOfBranch>

Page 10: [@NaukriEngineering] Git Basic Commands and Hacks

Git Shortcuts

git alias

git config --global alias.ci commit

git config --global alias.co checkout

git config --global alias.br branch

git config --global alias.st status

Page 11: [@NaukriEngineering] Git Basic Commands and Hacks

Tip and Tricks

Pull frequently

Commit early and often

Make logical commit messages

Write understandable commit messages

Push when your changes are tested

Branch freely

Merge carefully

Stash before switching branches

Stash with meaningful messages

Page 12: [@NaukriEngineering] Git Basic Commands and Hacks

Thank you