Last updated by
6 months ago
Page: Checking Projects into SVN, Version:15
Checking Projects into SVN or Git
Author: Marc PalmerAuthor: James LorenzenTable of Contents- Creating a new project and putting it into SVN
- Fixing an existing project that is already in SVN
- Checking out from SVN
- Adding a new project to Git
- target/
- web-app/plugins/
- web-app/WEB-INF/classes/ - common if you use Eclipse or STS
- plugins/
- test/reports/
.project and .classpath files. These files are required by Eclipse and STS to function. Even if you do not use Eclipse or STS, someone else who wants to check out the project may. Ignoring these files in your SCM will make it very difficult for Eclipse and STS to recognize the project.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 check in 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 "target" . svn rm web-app/WEB-INF svn rm target 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
Adding a new project to Git
To check a project into git for the first time, use the following commands:cd MyProject
git init
echo target >> .gitignore
echo web-app/WEB-INF >> .gitignore
git add .
git commit -m "Initial commit"