On 2019-11-21, at 12:44 AM, Uwe Brauer <o...@mat.ucm.es> wrote:

>>>> "PO" == Philip Oakley <philipoakley@iee.email> writes:
> HI Philip
> 
> 
>> Hi Uwe,
> 
> [Snip]...
> 
> 
>> So in Git, you can add 'everything', a few things, or even pick lines from 
>> files, for each commit, leaving the worktree (real filesystem content) 
>> distinct from the 'staging area/index' (equivalent to the old fashioned 
>> outbox on your desk-top ready to summon a clerk to 'file'[commit] it's 
>> contents).
> 
>> It's disadvantage is that most modern folks don't have the mental model or 
>> imagery in their heads to know what to do, and the Git documentation is 
>> very poor at describing these mental model things.
> 
> Tanks for the detailed answer. Let me try to reword it.
> 
> 
> 
>    1. I have a registered file in git.
> 
>    2. I do a lot of changes in different   lines.
> 
>    3. So I can commit either all of them or just some parts.
> 
>    4. The command git add . Tells git to use them all,
> 
>    5. then git commit -m   "my changes" will in fact commit them all. Is this 
> correct?
> 
> 
> If so I must say that the wording is not optimal. I thought add is for
> adding files not commits.
> 
> Mercurial has the same behavior, as the one described above, only the other 
> way around.
> 
> 
>   hg commit -m "my changes"
>   will per default commit everything. If I want to pick only some
>   changes I have to run
>   hg commit -i  
> 
> Uwe 

Maybe this idea will help you understand.

Git maintains a "potential next commit" at all times. This is called the index, 
or staging area.

The "add" command is used to put something into the potential next commit.

Commit in turn just copies that potential next commit into a long-term store.


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/A60780B9-9D71-4350-86D8-26E2CF005576%40gmail.com.

Reply via email to