The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

vania.vergara (3) [Avatar] Offline
#1
In the page 8, your note about 'git add' command said that it's possible to have to use add more than one time, but it's not clear how we can detect that need. The user has always to open the index file?
Mike McQuaid (83) [Avatar] Offline
#2
Re: command git add
Sorry Vania, I'm not quite sure what you mean. The user should never have to open the index file.

You can add multiple files by running e.g. `git add file1.txt file2.txt file3.txt`.
Misa (43) [Avatar] Offline
#3
Re: command git add
I think Vania is referring to this text, which confused me as well:

Does git add need run more than once?
Unlike some other version control systems git add may need to
be run more than once for any particular file.
It is not saying just for
Git to add this file to the repository but to add the current contents
of the file to the index staging area to build the next commit.

Under what circumstances is the condition "may need to be run more than once" relevant?
vania.vergara (3) [Avatar] Offline
#4
Re: command git add
That's correct Misa, it's exactly my point.
Mike McQuaid (83) [Avatar] Offline
#5
Re: command git add
Fixed this, thanks. Will be in the next MEAP release.

The new text is as follows:
> NOTE: After you have added changes for `GitInPractice.asciidoc` to the index staging area with `git add` they will be used in the next commit. After these changes to `GitInPractice.asciidoc` have been committed with `git commit` (introduced in <<committing-changes-to-files-git-commit>>smilie if you wish to add more changes to `GitInPractice.asciidoc` you will need to run `git add GitInPractice.asciidoc` again. This is because, unlike some version control systems, `git add` is used both to initially add a file to the Git repository but also to request the changes to the file be used in the next commit.
vania.vergara (3) [Avatar] Offline
#6
Re: command git add
That's perfect Mike, thanks.
Mike McQuaid (83) [Avatar] Offline
#7
Re: command git add
A pleasure.