git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Thomas AndersonNext: Thomas Anderson
Message 5 of 9 in “a few beginner git questions”
  1. Thomas AndersonMar 6, 2010
  2. Allan WindMar 6, 2010
  3. TaitMar 6, 2010
  4. Thomas AndersonMar 7, 2010
  5. Dmitry PotapovMar 7, 2010
  6. Thomas AndersonMar 7, 2010
  7. Dmitry PotapovMar 7, 2010
  8. TaitMar 8, 2010
  9. Junio C HamanoMar 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.