I believe that when you submit a file using Eclipse's Git plug-in, There is a problem with the possibility of accidentally submitting unnecessary documents (such as the. project,.classpath file or the. Settings folder and the files below), and there is no way to ignore the files.
The simple way to do this is to create a new. gitignore file in the project directory, and then declare the folder or file you want to ignore in it. Troublesome place to come, because the file is the point at the beginning, no file name, no way to create directly under Windows. We can create a new. gitignore file through Linux by installing Git and then right-clicking on "Git Bash here" in the project root directory.
The detailed steps are as follows: Install git and download the latest git for the Windows platform on Git's website first. When the download is complete, click Install, in the "select
Components "Step, remember to select Simple context menu (pictured below). Other by default, direct click Next to install complete.
Right-click on "Git Bash here" to enter the command line on the project root directory. Enter the vim. Gitignore command to edit the content
. Project
. classpath
. settings
. gitignore
Press Wq to save the exit and the. gitignore file will be generated. When you commit with git at this point, you will not see any of the above excluded files. There are two modes of gitignore file filtering, open mode and conservative mode Open mode is responsible for setting and filtering which files and folders
settings/means filtering this folder
*.zip Filter zip suffix file
Test.java Filter The file conservative mode is responsible for setting which files are not filtered, that is, which files to be tracked.
!src/Tracking This folder
!*.java Trace Java source files
! Test.java Trace the file
Tips: Open mode and conservative mode can be used in combination with the method of configuration. There are a lot of folders and files under one folder, and I just want to keep track of one of the files. You can use open mode to set the entire directory to not track, and then use conservative mode to set the file in this folder to be tracked to be tracked, you can only track a file.