Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
444 views
in Technique[技术] by (71.8m points)

git - .gitignore file for java eclipse project

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
question from:https://stackoverflow.com/questions/18726217/gitignore-file-for-java-eclipse-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...