[Turn] how to use .ignore plug ignore unnecessary documents submitted in IntelliJ IDEA

https://blog.csdn.net/qq_34590097/article/details/56284935

 

Recently beginner Git, and the IDE using IntelliJ IDEA, IDEA found in submitting projects to the local repository when the contents of the folder will .idea also submit up, this configuration information is put inside a number of projects, including history record, version control information. Git can not spread to go above. 
This time you need to write files to ignore .gitignore submit these documents. There is a plug-in .ignore can help us do this in the IDEA.

First look at how to install.

Click File-> Settings 


Plugins found in the left menu, click Browse repositories ...

Search .ignore, click Install, after the installation is complete can be pleasant to use, but this was before the restart IDEA 


However, the above method restart after installing IDEA time can cause an error. . ( 'ཀ `" ∠) _ Do not hit me ah, as to why I do not know. So to you planB: https: //plugins.jetbrains.com/idea/plugin/7495-ignore 
go to this website to download a good archive, select Install plugin from disk.


Restart finish could really use the ~!

Right on the project -> New -.> Ignore file  -.> Gitignore file (Git)
 
first select Example user template Well, after what he wants to filter can add their own, and finally click Generate to generate ~

 
Then you will find the file name is ignored turned gray with wood have ah! You can submit code pleasant - 


You can also right file to add it to ignore the list 


The following are some of .gitignore file matching rules ignored:

* .a # ignore all files ending .a
! lib.a # except lib.a
/ TODO # only ignore the TODO file in the root directory of the project, not including subdir / TODO
build / # ignore all files in the build / directory
doc / *. txt # ignore doc / notes.txt but not including DOC / Server / arch.txt

.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: 
git RM -r -cached filePath 
git the commit -m "the Remove xx" 
Or: 
git RM -r -cached. 
Git the Add. 
git commit -m "update .gitignore"

To explain several parameters -r is to remove the folder and its subdirectories -cached is to remove the staging area where the files without deleting the files in the workspace, the first one is to delete a file, the second method put All temporary area where the files deleted, together again, equivalent to update it again.
--------------------- 
Author: This is a natural 
source: CSDN 
Original: https: //blog.csdn.net/qq_34590097/article/details/56284935 
copyright notice : This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin blog.csdn.net/kingdelee/article/details/85270121