Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git status show files between ""

Tags:

git

git-status

I made git status command and get this:

#   "public/images/wallpaper/wait/1920\321\2051080.jpg"
#   public/style.css

Why some files are between quotes? And how I can add to .gitignore them?

like image 760
asiniy Avatar asked Nov 20 '13 15:11

asiniy


People also ask

What file states are shown by git status?

The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git. Status output does not show you any information regarding the committed project history.

How do I check my git status?

To check the status, open the git bash, and run the status command on your desired directory.

Why does git show that all my files changed when I didn't change them?

These changes mean that metadata about your file changed, however the content of your file did not. If you're working in a group, this may start to intefere with pushes or just add noise to your commits.


1 Answers

They are shown between quotes because the file name contains backslashes. In the shell, backslashes have a special meaning, so you have to either escape them or quote them.

The quotes are a convenience so you can just copy and paste git status's output, e.g., to add the file to the index:

$ git add "public/images/wallpaper/wait/1920\321\2051080.jpg"
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ copied and pasted

You can just add the filename to .gitignore without the quotes. Most probably, you'll want to add something like this to your .gitignore file:

public/images/wallpaper/wait/*.jpg
like image 134
Roberto Bonvallet Avatar answered Oct 03 '22 15:10

Roberto Bonvallet