I am learning git and using the excellent tutorials at http://gitimmersion.com to help me, but am struggling with several basic concepts that seem so basic/essential/fundamental that most tutorials gloss over them without really delving into their details:
- I understand the with git, you first "stage" changes to your local repo via
git add, and then you commit the changes to your local repo viagit commit. But what's the point of this? What value does this "2 phase commit" add? Why would I ever stage changes, then continue coding, then stage more changes, and then finally commit all of them? Why wouldn't I just add & commit all my changes at once? - Still not completely understanding the concept of
HEAD. Is HEAD simply the most recent state/version of the particular branch you have checked out? - When you merge 2 branches, are the merged changes considered "staged" or "committed"? For instance I merge my
big-project-branchback into mymasterbranch. Is mymasterbranch ready to be pushed off to a remote (original) repo? Or do I need to commit it first? - I have heard the term "interactive mode"? What is this (with resepct to git)? Are there other modes besides this?
Thanks in advance!