Re: git not tracking changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Deepak Barua <dbbarua@xxxxxxxxx> wrote:
> Hi,
>    When i do a git add of a config.h file then make some changes and
> then do git commit it does not reflect the changes..
> eg
> dep@zion:~/programs/elinks/elinks-0.11-20061220$ git add config.h

Here you told Git to take the current contents of config.h and
stage it into the index.  That content will be in the next
commit.

> dep@zion:~/programs/elinks/elinks-0.11-20061220$ vi config.h

Then you modify it.  Git doesn't know about those changes to
config.h, nor does it care at this point.

> dep@zion:~/programs/elinks/elinks-0.11-20061220$ git commit
> nothing to commit

This is occuring because the content staged in the index does not
differ from the content in HEAD (the last commit on this branch).
You need to run `git add config.h` again now that you have modified
it to restage the modified file.

Basically I'm assuming that when you ran `git add config.h` the
first time the content must have matched HEAD, which meant you
didn't actually stage anything.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]