MeltingDog
MeltingDog

Reputation: 15458

Git: after merge I see a new untracked file `\032\032` I can't get rid of

I merged some changes up to Github and afterward ran git status and same a new untracked file:

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       "\032\032"

I've checked in the directory and there is no new file or directory there. I also tried running rmdir and rm -i but both times I get a No such file or directory message.

How can I remove this?

Upvotes: 0

Views: 242

Answers (3)

torek
torek

Reputation: 489083

\032 is an unprintable ASCII-range control character, the SUB or Substitute character control-Z. You have a file that is literally named CTRL-ZCTRL-Z. Git knows that attempting to display this undisplayable character will fail, so instead it prints, inside double quotes, the C-style escape sequences that would generate the characters in a C string: \032 = octal 32 = decimal 26 = control-Z.

It's not clear how you got this file, but since it's "untracked", it's not in Git at all, it is merely in your work-tree.

It's also not clear how you should remove that file, since CTRL-Z is often eaten by something else long before you can give it to a "delete file" command. If you are on a Unix-like system with a Unix-like shell (sh or bash for instance), you can use:

rm $'\032\032'

since these shells expand octal backslash sequences inside $'...'.

Upvotes: 3

Sajib Khan
Sajib Khan

Reputation: 24184

Try Hard Reset to the last commit -

$ git add .
$ git reset --hard HEAD

Upvotes: 1

Denis Enrico Hasyim
Denis Enrico Hasyim

Reputation: 278

try "git stash" to get rid of it.

Upvotes: 6

Related Questions