0

We're migrating from SVN to git and now having the problem that we need any replacement for our svn externals. Unfortunately, submodules are not solving our problems since any change in the submodule requires an update of the parent project. So we found the git-externals repository (see https://github.com/develer-staff/git-externals) Everything works very well, but when running git externals update, we're facing the following error message:

externals sanity check passed!
External git-externals
Retrieving changes from server:  git-externals
Fetching origin
Checking out branch master
error: Sparse checkout leaves no entry on working directory
<GitError: 1 "git checkout master" None>

I already checked out many other questions/answers regarding this problem here on SO, but nothing worked for me. I'm also not sure which directory I need to pass in when I run echo my-test-dir/* > .git/info/sparse-checkout because when I run git externals update, it first checks out the repository to the .git_externals-directory (instead of my-test-dir). So I'm not sure if I need to do echo my-test-dir/* > .git/info/sparse-checkout or echo .git_externals/* > .git/info/sparse-checkout. But unfortunately none of them worked till now.

In my case the git_externals.json looks like:

{
    "https://github.com/develer-staff/git-externals": {
        "branch": "master",
        "ref": null,
        "targets": {
            ".": [
                "my-test-dir"
            ]
        },
        "vcs": "git"
    }
}

I simply added the git-externals repo as external.

Is anyone having any idea how I can solve this issue? Or maybe anyone know any other good replacement for replacing svn externals?

Nrgyzer
  • 783
  • 1
  • 14
  • 38

1 Answers1

0

I am a member of the team that developed Git X-Modules, which was intended to bring the svn:externals experience to Git and be better replacement to Git submodules. Since you're expressly asking for a replacement advice, I may suggest that you check it out. Hopefully this doesn't break the StackOverflow rules :-)

Git X-Modules is a server-side app, that synchronizes external repositories with folders in the parent project. For end-users the parent project is just a regular Git repository, that they can clone, push to etc. If the external repository is updated, the changes are automatically fetched to the parent project.

Yann_Ba
  • 46
  • 2
  • Thank you very much, but git-x isn't free or an open source tool, right? – Nrgyzer Aug 08 '21 at 08:47
  • There's a command-line version, that is free and will be open-source soon. The plugin for Bitbucket app and the upcoming cloud service are paid. – Yann_Ba Aug 09 '21 at 09:03