views:

215

answers:

1

I want to backup my code using smart Git. As a start I am a bit confused, IntelliJ has created two folders for my GRails project:

these reside in 1) C:\Documents and Settings\me\.grails\1.2.1\projects

and

2) C:\Documents and Settings\me\IdeaProjects\

The 1) contains a plugins folder which contains directories and files of plugins I am using inside my project.

Do I have to include both 1) and 2) directories inside GIT?

If yes what can I ignore?

If no which of the files do I have to include

Thanks,

Much appreciated,
WB

+1  A: 

Stuff under the .grails folder shouldn't be version-controlled. That's where classes are compiled, temp files are created, etc. Also plugins get installed there but typically you don't want to check those in since they're derived.

Another developer who checks out your code will have the plugins listed in application.properties and when running for the first time Grails will detect that they're not installed and install them.

As for your project code, most files that you wouldn't want to check in are now created in the target directory, so that should be in your git ignore but most everything else other than log files should be checked in.

Burt Beckwith
Burt,This is how my .gitignore looks like *.iws *.iml *.ipr *.log lib obj bin .idea .classpath .project .settings .classpath /*.launch /*.tmproj # web application files that are overwritten by "grails upgrade" # cf. GRAILS_HOME/scripts/Upgrade.groovy, target( upgrade ) /web-app/WEB-INF # logs stacktrace.log /test/reports # project release file *.war
WaZ
You should probably not exclude IDE files (.classpath, .project, the IntelliJ stuff, etc.), otherwise other developers will have to re-create those.
Burt Beckwith
Yes Burt I agree but I am the only one working on this project, so that should be fine?
WaZ
Sure. I'd still check them in though to avoid having to recreate them if you lose them, but it's not a big deal either way.
Burt Beckwith