Question

I've ported a SVN repo to GIT, but previously I have an svn:external file and it's not recognized in GIT. Is it possible to do external files like SVN where you have a single source of a file, but checked-out into other directories of the same repo?

For example:

- test/img/hello.gif (original file)
- test2/img/hello.gif (references the first file)
- test3/img/hello.gif (references the first file)

I've read some things around 'sparse-checkout' but not sure how you could actually just reference/check out one file.

Was it helpful?

Solution

Since you have only one repo, you cannot use the "submodule following a branch" feature.

That leaves only symlinks (I agree here with Zach Latta's comment), even though they are tricky to put in place when used with Windows: see "Git Symlinks in Windows".
A symlink isn't exactly the equivalent of an SVN:external (since it cannot reference a specific revision like svn:external can), but it can be a good enough workaround in your case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top