Hide git Untracked files

On the project, right-click "git bash here", and then enter git status 
to find that there are many untracked files, as shown in the figure:




How to hide these untracked files
1. The .gitgnore file must be placed in the root directory of the
project (such as the project name For testpro, this file needs to be placed under the testpro folder)
2. Write the files that need to be hidden into .gitgnore
such as:
.idea/artifacts/
.idea/compiler.xml
.idea/dictionaries/
.idea/encodings .xml
.idea/kotlinc.xml
.idea/libraries/

Execute again: git status
, you can see that the information written to the .gitgnore file is hidden, as shown in the figure: The








configuration example is as follows:
.idea/artifacts/
.idea/compiler. xml
.idea/dictionaries/
.idea/encodings.xml
.idea/kotlinc.xml
.idea/libraries/
.idea/misc.xml
.idea/modules.xml
.idea/uiDesigner.xml
.idea/workspace.xml
target/
##.gitgnore The file must be placed in the root directory of the project (if the project name is testpro, this file needs to be placed under the testpro folder)
#1: # is note 2 : You can use the regular expression used by the shell for pattern matching
#3: The matching pattern followed by "/" indicates that the directory to be ignored
#4: Use! Negative (for example, the directory contains test.a, and the gitignore file contains
#*.[oa], if you add !test.a to the file, it means to ignore the suffix .a or .o except the test.a file. file)

#### Examples are as follows
# Ignore .gitgnore files . gitignore .gitignore.bak
# Manual maintenance of .gitgnore, no need to submit #!.gitignore # Ignore files that end with .txt *.txt *.bak












Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326481173&siteId=291194637