0

I have this class library that I want to use in several different solutions. Rather than just referencing the dll, I added this project to the solutions via Add-->Existing Project and referenced this project from within the others. The rationele was that I do not have to keep the class library solution open all the time and any change I would make to the source code of this library in a different solution would also reflect to the original. But I have a problem with source control. Since it is added as an existing project, Git does not control it in solutions other than the original. Is there a way to commit the original class library project when I make changes on it from another solution?

John L.
  • 1,825
  • 5
  • 18
  • 45
  • Your question is unclear, but in any case adding build artifacts, libraries, binaries, etc., such as DLL files, is not a good idea. In general, build artifacts should not be versioned by Git. – Tim Biegeleisen Nov 21 '16 at 05:18
  • @TimBiegeleisen Actually the shared project has its own repository. What I am trying to accomplish is to trigger a commit when it is modified in another solution. – John L. Nov 21 '16 at 05:21

1 Answers1

0

Rather than just referencing the dll, I added this project to the solutions via Add-->Existing Project and referenced this project from within the others.

You can do that manually through git submodules, making sure that the repo for that solution is following its own master branch.

git submodule add -b master -- /url/library

That way, you can on demand refresh the content of that submodule: if any changes have been done elsewhere, a git submodule update remote will update its content.

Note that those have to be done in command-line, since Visual Studio support for submodule is still planned: see UserVoice "Commit changes to a submodule using VS" (planned since Oct. 2016)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250