0

I have a repository called "Random_Projects". Under it, I have small Java mini-projects.

Let's say it look something like this:

Random_Projects
        |__ Some_project
        |       |
        |       |__ build
        |       |   |__ <some files>
        |       |
        |       |__ lib
        |       |   |__ <some files>
        |       |
        |       |__ src
        |           |__ source_code_1.java
        |           |__ another_source.java
        |
        |__ Different_Project
        |       |
        |       |__ build
        |       |   |__ <some files>
        |       |
        |       |__ lib
        |       |   |__ <some files>
        |       |
        |       |__ src
        |           |__ different_source.java
        |           |__ source_different.java
        |
        |__ <more projects with same structure>

The only things I need to be sync between my machine (via SVN) is the src folder and the content inside it.

How should I configure my SVN to ignore everything except for the src folder of each java mini-projects in my _Random_Projects_ repository?


EDIT #1

So the answer in this post shows that sparse checkouts might solve the issue. However, from what I read, it is used only when the repo has all the files and you want to only retrieve (update) specific files/directories.

My case is different because I have to download everything except for the source folder from a different source. To top it off, my targeted directory is under a directory of unknown name (so what I want to be versioned is: repo/*/src/*)

In short:

Is there a way to have SVN automatically version files in this pattern: ./*/src/*?

Programer Beginner
  • 1,377
  • 6
  • 21
  • 47
  • `ignore`the others – jhamon Sep 16 '19 at 13:18
  • @jhamon is it the best solution? isn't there any argument that does the exact opposite? Will ignoring other directory work on all mini-projects while retaining the directory structure? – Programer Beginner Sep 16 '19 at 13:26
  • Subversion? The world is going in the direction of Git. I'd also recommend not having dependencies in a /lib folder. Maven is the standard for life cycle and dependency management. Your situation is what Maven modules was invented for. – duffymo Sep 16 '19 at 16:39
  • @duffymo unfortunately I am using Subversion due to my college (requirement). – Programer Beginner Sep 16 '19 at 17:07
  • What an unfortunate idea: A university that has fallen behind. They should be presenting the new. Alas, it's hard for professors to keep up. They tend to teach what they know, which might not be the state of the art. All my other comments about Maven still hold. You can use Maven and modules with Subversion. – duffymo Sep 16 '19 at 17:12
  • @ProgramerBeginner you can easily create a partial checkout (i.e. sparse checkout / sparse directories) with SVN. See https://stackoverflow.com/q/50945/761095. – bahrep Sep 16 '19 at 17:45
  • @duffymo It should be perfectly fine for universities to teach SVN. Two most popular modern version control systems now are git and SVN. SVN is widely used in the enterprise. It seems that most open-source software projects now use git, but there are several big OSS projects such as FreeBSD using SVN. – bahrep Sep 16 '19 at 18:14
  • I agree that svn is still used, but the world is moving to Git. I would say that failing to present it is abdication of responsibility. – duffymo Sep 16 '19 at 18:22

0 Answers0