Git .gitignore be ignored

This translation from: .gitignore IS ignored by Git

My .gitignoreFile Seems to BE being ignored by Git - could at The .gitignore? File BE Corrupt my .gitignorefiles seem to have been ignored Git .gitignorefile is corrupted? Which file format, locale or culture does Git expect? What kind of file format, language or cultural environment Git need?

My .gitignore: My .gitignore:

# This is a comment
debug.log
nbproject/

From the Output git status: the git statusoutput:

# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       debug.log
#       nbproject/
nothing added to commit but untracked files present (use "git add" to track)

Would like the I debug.logand nbproject/not to appear in at The untracked Files List. I hope debug.logand nbproject/do not appear in the list of files that are not tracked.

Where should I start looking to fix this ? Where should I tackle this problem?


#1st Floor

Reference: https://stackoom.com/question/m34B/gitignore be ignored Git


#2nd Floor

IF you have have not tracked Even at The Files SO FAR, Git Seems to BE of Able to "know" the About Them the even the After the Add Them to you .gitignore. Even if you have not so far trace files, even if you add them to .gitignore, Git seems to be able to " I know "them.

NOTE: . First the commit your Current Changes, or you lose by Will Them Note: First, submit your current changes, or you will lose them.

Then run the following commands from the top folder of your Git repository: then run the following command from the top of the file Git repository folder:

git rm -r --cached .
git add .
git commit -m "fixed untracked files"

#3rd floor

Fixed. Fixed. OK, I created the .gitignore file in Notepad on Windows and it was not working. Well, I created .gitignore file in the Windows Notepad, but the file does not work. When I viewed the .gitignore file on Linux it looked like organised gibberish - perhaps Notepad had written out Unicode rather than ASCII or whatever 8-bit is. Something when I look .gitignore files on Linux, it looks like a mess - Maybe Notepad to write the Unicode rather than ASCII or any 8.

So I rewrote the file on my Linux box, and when I pulled it back into Windows it works fine! So I rewrote the document files on Linux, when I pull it back to Windows, it works well! Hurrah! Cheers!


#4th floor

One thing to also look at: Are you saving your .gitignore file with the correct line endings? S one thing to note: if you save the file with the correct .gitignore end of the line?

Windows: Windows:

If you're using it on Windows, are you saving it with Windows line endings? If you use it on Windows, whether to save it with Windows line endings? Not all programs will do this by default ; not all of the program defaults will do this; Notepad ++ and MANY PHP Editors default to Linux Line Endings SO at The Files by Will BE Server compatible. Notepad ++ and many PHP Editor Linux line endings default, so the file will be compatible with the server. One easy way to check this, is . In Windows Notepad open the file in a simple way to check is to open the file in Windows Notepad. If everything appears on one line, then the file was saved with Linux line endings. If everything is displayed on one line, the end of the line to save the file to Linux.

Linux: Linux:

IF you are the HAVING Trouble with at The File Working in A Linux Environment, Open at The File in AN Editor SUCH AS Emacs or nano . If you can not use the file correctly in Linux environment, such as Emacs or nano open a file editor. If you see any non-printable characters , then the file was saved with Windows line endings. If you see any non-printable characters, the file is saved to the Windows line endings.


#5th Floor

Another cause of this issue is blank spaces or tabs before the statement: Another cause of this problem is the former statements spaces or tabs:

Example: Example:

# Be aware of the following:
 notWorkingIgnore.*
workingIgnore.*

And as pointed out by the comment below a trailing space can be an issue as well: As noted in the comments below, trailing spaces may also be a problem:

# Be aware of the following:
notWorkingIgnore.* #<-Space
workingIgnore.*#<-Nospace

#6th floor

Adding the commit to your Another Without Project, One Line by Will BE enough to the make .gitignoreWork AS IT IS Supposed to: no need to add other submissions in the project, you can make just one line of .gitignorework:

git rm -r --cached debug.log nbproject

This will remove them from the repository, but still keep them physically. This will remove them from the store, but still maintain physical condition. In plain English, it deletes any history of changes related to them, and also will not track their change in any future commit. Plain English, it deletes any change history associated with them, and in any subsequent submission of We will not track their changes. May the Find A explanation of Better by You here Wallpaper . You may here find a better explanation.

Original articles published 0 · won praise 136 · views 830 000 +

Guess you like

Origin blog.csdn.net/xfxf996/article/details/105238025