Jeff
Jeff

Reputation: 1591

Git: Adding to index after already added? And other questions

I was able, in Eclipse, to add a file to index when I think it was already added.

The asterisk in the lower right corner showed up.
Does this mean that the file was not in fact already added?

If I create a new file while Git/Eclipse warn me that such a file will not make it into Git without first adding it to the index?

In general, are there circumstances when you will not be warned about a file that needs to be pushed to a remote repo so that it will not potentially be lost?

Upvotes: 1

Views: 28

Answers (1)

CodeWizard
CodeWizard

Reputation: 142114

I was able, in Eclipse, to add a file to index when I think it was already added

Once you add file you can still make changes to it. The new changes you make are not part of the stage area and if you want the new changes you have to re-add the file again.

Here is a demo of the above scenario: You can see that the file appears both in the working directory and in the stage area as well since it was modified after it was added.

enter image description here

Upvotes: 1

Related Questions