not required to submit the idea to ignore files

1. Open the git bash interface, go to the root directory of a project, execute the following command

touch .gitignore

In this case, again in the root directory of the project will create .gitignore text, open the text file editor to be ignored

# Compiled class file
*.class
target/
bin/

# Log file
*.log

# Package Files #
*.jar
*.war

#idea
*.iml
.idea/

#eclipse
.settings/
.classpath
.project

Prerequisites The document is in force these files are not being tracked.  

2. git rm -r --cached name of the directory / file name     to delete cache files

.gitignore can ignore those files had not been the track, if some files have been included in the version management, modifying .gitignore is invalid. Then the solution is to first delete the local cache (not track changes to the state), and then submitted to: 

Input: 

[Folder] git rm -r --cached .idea

[File] git rm --cached demo-project.iml

Such as delete off, you can force the removal with the -f attention must be coupled with --cached means only the buffer file

2. git rm -r --cached name of the directory / file name     to delete cache files

.gitignore can ignore those files had not been the track, if some files have been included in the version management, modifying .gitignore is invalid. Then the solution is to first delete the local cache (not track changes to the state), and then submitted to: 

Input: 

[Folder] git rm -r --cached .idea

[File] git rm --cached demo-project.iml

Such as delete off, you can force the removal with the -f attention must be coupled with --cached means only the buffer file

Guess you like

Origin www.cnblogs.com/alice-cj/p/11294389.html
Recommended