Re: Git commit behaving strangely

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

 



Hi Zeeshan,

Zeeshan Qureshi wrote:

> 3. then i added 1 new line to both closing.txt and file.txt
> 4. i added the file closing.txt to the staging are by running 'git
> add closing.txt'
> 5. now i ran 'git checkout' (by mistake)
[...]
> 7. Now when i run 'git commit -m "closing again"', the change is not
> committed even though i get a new commit id.
> 
> The output of 'git log -p' is this (as you can clearly see, there
> are new commits but no change has been recorded)

Strange.  I tried to reproduce this but I got different results
(the new commit includes in a change to closing.txt).  What am
I doing wrong?

 git init repo
 cd repo

 echo 'hello world' >file.txt
 git add .
 git commit -m 'Initial version of repo, a test repository'

 echo closing >closing.txt
 git add closing.txt
 git commit -m 'Goodbye, all'

 echo 'hi!' >>file.txt
 echo 'again?' >>closing.txt
 git add closing.txt

 git checkout
 git diff --cached

 git commit -m 'closing again'
 git log -p
--
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]