This is what git status shows after I modified the file and ran "git add":

 git status
# On branch fix99
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
# modified:   COMMON/pom.xml
#


This is what git commit with amend shows:

git commit COMMON/pom.xml --amend
# On branch fix99
# No changes
You asked to amend the most recent commit, but doing so would make
it empty. You can repeat your command with --allow-empty, or you can
remove the commit entirely with "git reset HEAD^".


On Tuesday, October 22, 2013 10:46:51 AM UTC-7, William Seiti Mizuta wrote:
>
> Hi Vicky,
>
> have you added your modified files to "changes to be commited" state? What 
> is the output of "git status" command?
>
>
> William Seiti Mizuta
> @williammizuta
> Caelum | Ensino e Inovação
> www.caelum.com.br
>
>
> On Tue, Oct 22, 2013 at 1:01 PM, Vicki Kozel <vicki...@gmail.com<javascript:>
> > wrote:
>
>> Hello,
>> we are using Git and Gerrit stack; since Gerrit is good about keeping 
>> track of an individual commits(changes), when a commit breaks CI, Gerrit a) 
>> prevents the change to be merged into master b)provides a patch branch a 
>> developer can checkout and amend the broken commit.
>>
>> I got into the situation when I made a change "A" that broke that build, 
>> so gerrit never merged the change into a master. I then checked out a patch 
>> with my change in it on top of history and reverted my change "A" to look 
>> like it looked before (and equivalent to a current master). "git status" 
>> tells me that I do have a modified file in my branch. But "git commit" 
>> tells me that my commit is empty.
>>
>> Is this because the SHA1 of the fixed file on my branch and SHA1 of the 
>> same file on the master are identical? To fix the situation I just add an 
>> empty line to a reverted file, to make it look a little different from 
>> master, and then git does not complain about an empty commit. What is the 
>> right practice in a situation like this?
>>
>> Thank you.
>> Vicki
>>
>> -- 
>> 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+...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to