6

I am in the following situation...

I am used to being able to check out a Subversion server subproject into JBoss as an exploded war: in my case, I call a directory Blah.war, put it in C:\jboss-6.1.0.Final\server\default\deploy\Blah.war, and JBoss picks it right up.

I'm having trouble doing this with Git. The SVN repository I'm pulling from is laid out as follows:

.../Project/trunk/Services
.../Project/trunk/Web

If I check the entire project into the deploy/ folder, there won't be a .war directory at the top. Obviously, I can't check out make trunk/ into my deploy/ directory. I've thought of using some kind of symbolic link, but can't see this working in Windows.

Does anyone have any idea how to do this? I've been hearing good things about DVCS, but Git is useless to me if I can't handle the server development use case.

orbfish
  • 7,381
  • 14
  • 58
  • 75

1 Answers1

9

That is a good illustration of the difference of granularity between SVN repo and git repo:

  • You can put everything in an SVN repo and only checkout the part you are interested in.
  • You are supposed to checkout all of a git repo

So ideally Services and web would be two repos.


Note that having one checked out git repo outside jboss, and a symbolic link can work, even on Windows, which does support symlink (with mklink).


Finally, if you don't want several repos or symlink, you can do a sparse checkout, with git read-tree, as describe in this blog post "Using Git Sparse Checkout", by Brian Coyner (briancoyner).

cd C:\jboss-6.1.0.Final\server\default\deploy\
git init Blah.war
cd Blah.war
git config core.sparsecheckout true
echo Web >> .git/info/sparse-checkout
git remote add -f origin /url/to/your/repo.git
git pull origin master
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you. You're probably right about the granularity, if I can sell it to my team, but it's good to know about the sparse checkout option. – orbfish Dec 20 '13 at 01:47