web123456

Configuration of .ignore in idea

A new project is created in idea, when you want to use git for project versioning, you can do it directly in idea, as shown below:
加粗样式
After successfully turning the project into a Git-managed repository, I found a lot of files in the idea that should have been ignored were in red because they hadn't been configured.gitignorefile. Just create a new .gitignore file in your project and add the appropriate configuration to commit to the repository.

# by'#'Lines that begin with a comment are treated as comments.

# Ignore all files with the name foo.txt's file.

foo.txt

# Ignore all generated html files,

*.html

# foo.The html is maintained manually, so the exception.

!foo.html

# Ignore all.o and.a Documentation.

*.[oa]
Configuration syntax:
Starts with a slash "/A directory is indicated by an asterisk beginning with "
Asterisks "*"Wildcard multiple characters;
With a question mark "?"Wildcard single characters
with square brackets"[]"A list of matches containing a single character;
With an exclamation point "!"Expressing non-neglect(follow sb's tracks)The file or directory to match to;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23