3

Ok, I've read it all, and tried to find solutions to my problem to no avail, so was wondering if anyone would be able to give me the ultimate solution to the migration issue I'm having.

It's to do with using SVN externals in GIT, so hold on to your chairs.

I have looked at the following topics only to find that no one has the exact same setup as I have.

Now my setup is really not that complicated, but I can't work out a way to get it working the way I need it. I have:

  • Project1
    • Core
    • Libs

I then have in my main project

  • MainProject
    • MainFolder
      • file.cs
      • file1.cs
      • file2.cs
      • Core (external of Project1)
    • Libs (external of Project1)

Obviously this is fine on SVN, as you can use externals, but with sub-modules, you can only create them pointing to the root of the repository, which in this case doesn't quite work for me, since I have both Core and Libs on the same repository. Moving them out isn't an option at this point, since we're still in the migration process, and I need to keep constantly syncing them.

I then thought I could just go and use symlinks (notice I'm on a windows environment), as this way I would be able to checkout my Project1 repository at the same level as my MainProject, and via symlinks make sure my project still thinks everything is where it should.

This magically worked, however, upon doing git status I now noticed Project1 was marked as Untracked files, and by committing this and pushing, and checking out again, my symlink was gone, and I now had a hard copy of my Project1 repository copied into MainProject.

This obviously turned out to be a bit of a nightmare ow, so I was just wondering if anyone could help me with this, and maybe point me towards the right direction.

Thanks in advance,

Marcos

1 Answer 1

1

While I believe Michael Geddes is working on supporting symlinks in a future msysgit2, there is one way to get that support right now (that you have mentioned)
"Git Symlinks in Windows"

It allows to restore symlinks on checkout in Windows.

If you add Project1 as a submodule of your main project:

  • it won't be displayed as untracked files in your git status.
  • you can add a symlink in MainFolder to (Project1/)Core in order to get the structure you want.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.