# Git issue report

2 messages from 2018-04-19 to 2018-04-19. Participants: xfswindy@163.com, Junio C Hamano.
Thread: https://gitlist.dev/t/48325

## xfswindy@163.com, 2018-04-19 03:30

Subject: Git issue report
Message-ID: <-tc3xop-8i635uwx53zom190jcbwyrl587bgic1u7ogu-h5ta7c-vg7tsu-9tjre9eq72we-wflfrt-v7y1d7-7ekgia-gbrcn9of96to-6fxlag-u56rt19q40x9-ved85k-25erwyma9au4-fjthm4-fwargr.1524108608363@email.android.com>
URL: https://gitlist.dev/e/-tc3xop-8i635uwx53zom190jcbwyrl587bgic1u7ogu-h5ta7c-vg7tsu-9tjre9eq72we-wflfrt-v7y1d7-7ekgia-gbrcn9of96to-6fxlag-u56rt19q40x9-ved85k-25erwyma9au4-fjthm4-fwargr.1524108608363%40email.android.com

```
Hi,
  I met a issue when using git.
I cannot delete the file by the commond 'git rm'.
The file name is a little diff from common file.
I accidentally named the file "filename\r", display such as filename^M. Then I commit the file by 'git add .'.
After I find this mistake, I remove the file, then try to use commond "git rm" to delete the file, but failed.

My git version is 1.7.9.5.
Is this issue reported?
If this issue is solved, could you tell me which version I should get.

Thanks!
Xiaofeng Chen
04/19/2018


```

## Junio C Hamano, 2018-04-19 05:33

Subject: Re: Git issue report
Message-ID: <xmqqbmefep6b.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqbmefep6b.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <-tc3xop-8i635uwx53zom190jcbwyrl587bgic1u7ogu-h5ta7c-vg7tsu-9tjre9eq72we-wflfrt-v7y1d7-7ekgia-gbrcn9of96to-6fxlag-u56rt19q40x9-ved85k-25erwyma9au4-fjthm4-fwargr.1524108608363@email.android.com>

```
"xfswindy@163.com" <xfswindy@163.com> writes:

> Hi,
>   I met a issue when using git.
> I cannot delete the file by the commond 'git rm'.
> The file name is a little diff from common file.
> I accidentally named the file "filename\r", display such as filename^M. Then I commit the file by 'git add .'.
> After I find this mistake, I remove the file, then try to use commond "git rm" to delete the file, but failed.
>
> My git version is 1.7.9.5.

The following works fine with v1.7.9.5 (I have separate installs of
various versions of Git and use "rungit $version" to choose from
them, so just read "rungit v1.7.9.5" below as if it is "git").

	$ rungit v1.7.9.5 init
        $ N=$(printf "filename\015")
        $ echo >"$N"
        $ /bin/ls fil* | od -cx
        0000000   f   i   l   e   n   a   m   e  \r  \n
                   6966    656c    616e    656d    0a0d
        0000012
        $ rungit v1.7.9.5 add .
        $ rungit v1.7.9.5 ls-files
        "filename\r"
        $ rm filename*
        $ rungit v1.7.9.5 rm filename*
        $ rungit v1.7.9.5 ls-files 
	$ /bin/ls
        $ exit

and I do not think of any reason why we would have broken it since.

FYI, you do not have to do a separate "rm filename*" in the above
sequence; "git rm filename*" would remove it from both the working
tree and from the index.  I did it in the above illustration in two
separate steps only because you said you removed and then did "git
rm" and I wanted to emulate it.

> Is this issue reported?

I do not recall hearing about it, but you must have looked for one
hard already and I haven't, so...

> If this issue is solved, could you tell me which version I should get.

It appears to me that such an issue did not exist in the first
place.


```
