Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore file for java eclipse project

Tags:

git

eclipse

I have java project that uses the Eclipse IDE.

The Eclipse workspace is pointing to this directory:

/home/srvimgprd/BUSPROJ/code_development/dime/executables/clientcode/java_axis/Eclipse

I have placed a .gitignore file in the workspace directory "Eclipse". See below.

What I need to do is to be able to download the items from the Eclipse directory onto a new machine and then compile with no issue.

Are there any concrete steps to accomplish this task? When using the .gitignore file below, nothing shows up on the target machine.


CONTENTS OF ECLIPSE DIRECTORY (on source machine): /home/srvimgprd/BUSPROJ/code_development/dime/executables/clientcode/java_axis/Eclipse


java_axis/Eclipse> ls -lart
total 48
drwxr-xr-x 2 imgdev development 4096 2013-09-09 04:53 RemoteSystemsTempFiles
drwxr-xr-x 4 imgdev development 4096 2013-09-09 04:55 Servers
drwxr-xr-x 4 imgdev development 4096 2013-09-09 04:58 .metadata
drwxr-xr-x 6 imgdev development 4096 2013-09-09 05:06 Axis2ClientDimeServer
drwxr-xr-x 5 imgdev development 4096 2013-09-10 08:30 ..
-rw-r--r-- 1 imgdev development  307 2013-09-10 08:31 .gitignore
drwxr-xr-x 6 imgdev development 4096 2013-09-10 08:31 .

CONTENTS OF .gitignore FILE


*target*
*.jar
*.war
*.ear
*.class

# eclipse specific git ignore
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch
like image 975
Casey Harrils Avatar asked Sep 10 '13 18:09

Casey Harrils


2 Answers

put .gitignore in your main catalog

git status (you will see which files you can commit)
git add -A
git commit -m "message"
git push
like image 52
Marcin Szymczak Avatar answered Oct 14 '22 01:10

Marcin Szymczak


You need to add your source files with git add or the GUI equivalent so that Git will begin tracking them.

Use git status to see what Git thinks about the files in any given directory.

like image 1
Ted Percival Avatar answered Oct 14 '22 03:10

Ted Percival