Re: a few beginner git questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]