Re: a few beginner git questions
- From
Dmitry Potapov <dpotapov@gmail.com>
- Date
- Mar 7, 2010, 09:08 UTC
- Message-ID
- <20100307090834.GB31105@dpotapov.dyndns.org>
- In-Reply-To
- <15b345f1003061823u2d7edeeo25229f0a32456f45@mail.gmail.com>
On Sat, Mar 06, 2010 at 08:23:18PM -0600, Thomas Anderson wrote:
> > What's the difference, then, between doing "stage, stage, commit" as > opposed to "stage, commit"?
Probably none... If you stage twice the exactly same file, it does not change anything. But if you "stage, stage" means to stage two different files while "stage" is to stage just one then the outcome will be different.
> Why not just make all commits stage automatically?
The goal of the stage area is to mark what changes you want to commit. So, one commit will contain only one semantic change and not everything what you have in your working tree at that moment. CVS also allows to not commit all changes at the same time (you can specify what files to commit in the command line), but with Git you can not only to choose what files but also what change in each file you want to commit now. More importantly, git allows you to look at the stage area and see what you are going to commit.
In simple cases, you can just do "git commit -a" which means to commit all changes for all tracked files or "git commit somefile" to commit changes only in "somefile".
Dmitry