Git notes and comparision with svn
Posted on 03 Şubat 2015 in Programlama by admin
A good git tutorial
https://www.atlassian.com/git/tutorials/
and another one
http://git-scm.com/book/en/v2/
Git notes.
What are the use cases for staging?
When you commit it’s only going to commit the changes in the index (the “staged” files). There are many uses for this, but the most obvious is to break up your working changes into smaller, self-contained pieces. Perhaps you fixed a bug while you were implementing a feature. You can git add just that file (or git add -p to add just part of a file!) and then commit that bugfix before committing everything else. If you are using git commit -a then you are just forcing an add of everything right before the commit. Don’t use -a if you want to take advantage of staging files.
You can also treat the staged files as an intermediate working copy with the –cached to many commands. For example, git diff –cached will show you how the stage differs from HEAD so you can see what you’re about to commit without mixing in your other working changes.
The other really common use is for when some of your changes should never be committed; for example, you can stage the good stuff, commit it, then blow away the bad stuff with git reset --hard
Example git flow
Following diagram is taken from : http://nvie.com/posts/a-successful-git-branching-model/
Some git commands:
Show commits that are not pushed:
git diff –stat origin/<branch_name>