git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: Thomas Anderson <zelnaga@gmail.com>
Cc: Tait <git.git@t41t.com>, git@vger.kernel.org
Subject: Re: a few beginner git questions
Date: Sun, 7 Mar 2010 12:08:34 +0300	[thread overview]
Message-ID: <20100307090834.GB31105@dpotapov.dyndns.org> (raw)
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

  reply	other threads:[~2010-03-07  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-06  6:42 a few beginner git questions Thomas Anderson
2010-03-06  7:01 ` Allan Wind
2010-03-06  7:05 ` Tait
2010-03-07  2:23   ` Thomas Anderson
2010-03-07  9:08     ` Dmitry Potapov [this message]
2010-03-07  5:02   ` Thomas Anderson
2010-03-07  8:50     ` Dmitry Potapov
2010-03-08 18:55     ` Tait
2010-03-07  9:39 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100307090834.GB31105@dpotapov.dyndns.org \
    --to=dpotapov@gmail.com \
    --cc=git.git@t41t.com \
    --cc=git@vger.kernel.org \
    --cc=zelnaga@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).