Last updated by
4 years ago
Page: Checking Projects into SVN, Version:5
Checking Projects into SVN
Author: Marc PalmerAuthor: James LorenzenTable of Contents- #Note
- #Creating a new project and putting it into SVN
- #Fixing an existing project that is already in SVN
- #Checking out from SVN
Note
The information in here should be easily adapted to CVS. Replace the svn propset svn:ignore commands to set the same text in .cvsignore files in the directories specified in the commands.Up to and including Grails 0.4.x there are files that are generated or copied by Grails within your project tree. This can be problematic as it is unclear what is to go into SVN and what isn't. In addition, you will not usually want your compiled .class files going into version control, nor duplicates of your libs etc.This is correct at the time of writing (Grails 0.4.x) but makes the following assumptions:
- You do not want ./plugins/core (Core Grails plugins) under SVN
- You do not want anything under ./web-app/WEB-INF/ under SVN. You should not usually need to put files in here. Files from ./conf are copied to WEB-INF/classes so they are on the classpath, if you need to supply anything.
Creating a new project and putting it into SVN
This approach is for use when starting a new Grails project - i.e. it does not yet exist on your disk at all, nor in SVN. It will talk you through your first check in, including the relevant svn:ignore properties, and avoids any checkin of these ignored files that may or may not exist locally.With SVN installed, create your project. We will use "MyProject" as the name for the purposes of demonstration:grails create-app MyProject cd <projname>
svn checkout <svn-server-url>/emptysvndir/ . svn add * svn propset svn:ignore "WEB-INF" web-app/ svn propset svn:ignore "core" plugins/ //as of grails v1.0.3 there is no plugins/core directory svn rm --force web-app/WEB-INF svn rm --force plugins/core svn commit -m "First commit"
Fixing an existing project that is already in SVN
This approach is for use when you have optimistically imported your entire project into SVN already and have started getting errors or are being annoyed by the warning messages relating to locally changed files.We will use "MyProject" as the name for the purposes of demonstration:cd MyProject svn propset svn:ignore "WEB-INF" web-app/ svn propset svn:ignore "core" plugins/ svn rm web-app/WEB-INF svn rm plugins/core svn commit -m "Fixing SVN"
Checking out from SVN
To checkout this project fresh locally or on another machine you will need to checkout as usual but then run:grails upgrade