Git essentials

455 views

Published on

Git essentials

Published in: Software
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
455
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Git essentials

  1. 1. Git essentials By Shailesh Kalamkar.
  2. 2. Introduction What is Git ? Why git ? Importance of Git.
  3. 3. Points to be covered More than clone, push and pull Edit last changes How to use gitk Setting up Merge tool Selecting specific commit to merge Stashing local changes and retrieving it Some configurations
  4. 4. Edit last changes Missed a file to commit/wrong commit msg ? $ git commit -m 'initial commit' $ git add forgotten_file $ git commit —amend Undo last commit $ git reset --soft HEAD^ # use --soft if you want to keep your changes $ git reset --hard HEAD^ # use --hard if you don't care about keeping the changes you made
  5. 5. Why to use Gitk? Go for gitk >> Demo
  6. 6. Setting up merge tool Use merging tools - example Kdiff3 Make sure that you have merge tool installed $ git config --global merge.tool kdiff3 When conflict occurs just fire following command $ git mergetool
  7. 7. Select specific commit to merge Go for cherry pick $ git cherry-pick a74cc83
  8. 8. Stashing local changes Don’t worry you can stash your changes Commands $ git stash #stashing the changes $ git stash pop #retrieving the changes
  9. 9. Some commands Colour your Git. $ git config --global color.ui auto Checkout remote branch on local $ git fetch $ git checkout -b branch_name origin/branch_name Check branch merging $ git branch --merged $ git branch --no-merged
  10. 10. Thank you!

×