简体   繁体   中英

Gitignore not ignoring certain project.properties

I am using the github app for windows and mac and I am having a problem with my .gitignore file.

I am trying to ignore the project.properties file that gets generated when switch between my two machines but I simply cannot seem to get it to work.

Below is a copy of my .gitignore, and it seems to be working well for everything except for the project.properties, as well as the gen/* that I have in there yet that is less annoying.

I have been researching this for a while and haven't found an answer, I would appreciate any help!

# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties
.properties

# Proguard folder generated by Eclipse
`enter code here`proguard/

#Log Files
*.log

project.properties
*.properties
project.properties

I suspect you added the project.properties line to .gitignore after that file had been committed.

What you need to do is the following:

git rm --cached project.properties

and for gen/*

git rm --cached gen/

Then commit.

the --cached option will unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone. git-rm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM