How to make git ignore files (configure .gitignore) [closed]

0

I am learning to use git by doing a simple project in Java without using a development environment (compiling directly from the terminal). I want git to ignore the files .class that as you already know are the Java binaries.

I've been researching how to do this and what I have to do is create a file .gitignore with a line that contains the following rule: *.class .

The problem I have is that I do not know where to put that file, I guess in the root directory of my project or in the .git directory. Has anyone ever done this and can you help me?

PS: I am using Windows using the program that I downloaded from the official page .

    
asked by jpuriol 30.11.2016 в 16:34
source

3 answers

0

The problem I had is that it is not worth just creating the file (in the directory that is) .gitignore . Then you have to add it to the project with git add and then do commit .

    
answered by 30.11.2016 / 17:35
source
0

You have to put it in the root of your project.

    
answered by 30.11.2016 в 16:37
0

All you have to do is put it in the root of your project and enter the following:

If you have a folder called "folder" type: / folder / and with that you will ignore the entire folder. If it is a file "ejm.class" type: /path/ejm.class

    
answered by 30.11.2016 в 17:00