Package Manager vs. Git Submodule/Subtree





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







7















Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.



Assume that the space-saving benefit of git submodules is not important.



Update: Someone added a C++ tag to this question, but I have removed it since. This question did not specifically pertain to C++. More general answers than the accepted answer are welcome.










share|improve this question

























  • I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

    – Konrad
    Dec 22 '18 at 0:40













  • I assume your question relates to C/C++ projects here?

    – Konrad
    Dec 22 '18 at 0:47











  • @Konrad No, I was asking about package managers in general.

    – NetherGranite
    Jan 4 at 6:24


















7















Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.



Assume that the space-saving benefit of git submodules is not important.



Update: Someone added a C++ tag to this question, but I have removed it since. This question did not specifically pertain to C++. More general answers than the accepted answer are welcome.










share|improve this question

























  • I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

    – Konrad
    Dec 22 '18 at 0:40













  • I assume your question relates to C/C++ projects here?

    – Konrad
    Dec 22 '18 at 0:47











  • @Konrad No, I was asking about package managers in general.

    – NetherGranite
    Jan 4 at 6:24














7












7








7


4






Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.



Assume that the space-saving benefit of git submodules is not important.



Update: Someone added a C++ tag to this question, but I have removed it since. This question did not specifically pertain to C++. More general answers than the accepted answer are welcome.










share|improve this question
















Are there any reasons to use a package manager rather than git submodules/subtrees, or vice versa? The git solutions seem to be a lot more hassle than a simple package manager.



Assume that the space-saving benefit of git submodules is not important.



Update: Someone added a C++ tag to this question, but I have removed it since. This question did not specifically pertain to C++. More general answers than the accepted answer are welcome.







git-submodules package-managers git-subtree






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 4 at 6:25







NetherGranite

















asked Sep 10 '18 at 11:07









NetherGraniteNetherGranite

702325




702325













  • I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

    – Konrad
    Dec 22 '18 at 0:40













  • I assume your question relates to C/C++ projects here?

    – Konrad
    Dec 22 '18 at 0:47











  • @Konrad No, I was asking about package managers in general.

    – NetherGranite
    Jan 4 at 6:24



















  • I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

    – Konrad
    Dec 22 '18 at 0:40













  • I assume your question relates to C/C++ projects here?

    – Konrad
    Dec 22 '18 at 0:47











  • @Konrad No, I was asking about package managers in general.

    – NetherGranite
    Jan 4 at 6:24

















I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

– Konrad
Dec 22 '18 at 0:40







I think using some kind of package manager is simpler than git submodules/subtrees... dependencies in languages like C#(nuget), node(npm) or rust(cargo) are never copied, only file with dependency list is in the repo

– Konrad
Dec 22 '18 at 0:40















I assume your question relates to C/C++ projects here?

– Konrad
Dec 22 '18 at 0:47





I assume your question relates to C/C++ projects here?

– Konrad
Dec 22 '18 at 0:47













@Konrad No, I was asking about package managers in general.

– NetherGranite
Jan 4 at 6:24





@Konrad No, I was asking about package managers in general.

– NetherGranite
Jan 4 at 6:24












1 Answer
1






active

oldest

votes


















4





+50










The git solutions seem to be a lot more hassle than a simple package manager.




This is not about hassle.



This is about two different ways to build a project:




  1. through binary dependencies, with a package manager (Nexus, or Conan for C++: you declare your dependencies, and the package manager fetches them and uses them during the compilation.

  2. through source dependencies, with Git submodules or subtrees, where you store references to other source code, import them, and recompile everything.


The first is good when building a system, where each part has its own release lifecycle, and you want to depend to pre-built dependencies.



The second is used when the dependencies are more tightly linked to the main program.



Or when there are no binary dependencies (which is the case, for instance, with Go and its modules).






share|improve this answer





















  • 2





    What do you mean by more tightly linked?

    – Konrad
    Dec 23 '18 at 9:58











  • By binary dependencies you mean linking to pre-built static or dynamic libraries?

    – Konrad
    Dec 23 '18 at 10:00











  • @Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

    – VonC
    Dec 23 '18 at 11:12











  • @Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

    – VonC
    Dec 23 '18 at 11:13











  • I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

    – NetherGranite
    Jan 4 at 6:21












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52256490%2fpackage-manager-vs-git-submodule-subtree%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4





+50










The git solutions seem to be a lot more hassle than a simple package manager.




This is not about hassle.



This is about two different ways to build a project:




  1. through binary dependencies, with a package manager (Nexus, or Conan for C++: you declare your dependencies, and the package manager fetches them and uses them during the compilation.

  2. through source dependencies, with Git submodules or subtrees, where you store references to other source code, import them, and recompile everything.


The first is good when building a system, where each part has its own release lifecycle, and you want to depend to pre-built dependencies.



The second is used when the dependencies are more tightly linked to the main program.



Or when there are no binary dependencies (which is the case, for instance, with Go and its modules).






share|improve this answer





















  • 2





    What do you mean by more tightly linked?

    – Konrad
    Dec 23 '18 at 9:58











  • By binary dependencies you mean linking to pre-built static or dynamic libraries?

    – Konrad
    Dec 23 '18 at 10:00











  • @Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

    – VonC
    Dec 23 '18 at 11:12











  • @Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

    – VonC
    Dec 23 '18 at 11:13











  • I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

    – NetherGranite
    Jan 4 at 6:21
















4





+50










The git solutions seem to be a lot more hassle than a simple package manager.




This is not about hassle.



This is about two different ways to build a project:




  1. through binary dependencies, with a package manager (Nexus, or Conan for C++: you declare your dependencies, and the package manager fetches them and uses them during the compilation.

  2. through source dependencies, with Git submodules or subtrees, where you store references to other source code, import them, and recompile everything.


The first is good when building a system, where each part has its own release lifecycle, and you want to depend to pre-built dependencies.



The second is used when the dependencies are more tightly linked to the main program.



Or when there are no binary dependencies (which is the case, for instance, with Go and its modules).






share|improve this answer





















  • 2





    What do you mean by more tightly linked?

    – Konrad
    Dec 23 '18 at 9:58











  • By binary dependencies you mean linking to pre-built static or dynamic libraries?

    – Konrad
    Dec 23 '18 at 10:00











  • @Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

    – VonC
    Dec 23 '18 at 11:12











  • @Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

    – VonC
    Dec 23 '18 at 11:13











  • I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

    – NetherGranite
    Jan 4 at 6:21














4





+50







4





+50



4




+50






The git solutions seem to be a lot more hassle than a simple package manager.




This is not about hassle.



This is about two different ways to build a project:




  1. through binary dependencies, with a package manager (Nexus, or Conan for C++: you declare your dependencies, and the package manager fetches them and uses them during the compilation.

  2. through source dependencies, with Git submodules or subtrees, where you store references to other source code, import them, and recompile everything.


The first is good when building a system, where each part has its own release lifecycle, and you want to depend to pre-built dependencies.



The second is used when the dependencies are more tightly linked to the main program.



Or when there are no binary dependencies (which is the case, for instance, with Go and its modules).






share|improve this answer
















The git solutions seem to be a lot more hassle than a simple package manager.




This is not about hassle.



This is about two different ways to build a project:




  1. through binary dependencies, with a package manager (Nexus, or Conan for C++: you declare your dependencies, and the package manager fetches them and uses them during the compilation.

  2. through source dependencies, with Git submodules or subtrees, where you store references to other source code, import them, and recompile everything.


The first is good when building a system, where each part has its own release lifecycle, and you want to depend to pre-built dependencies.



The second is used when the dependencies are more tightly linked to the main program.



Or when there are no binary dependencies (which is the case, for instance, with Go and its modules).







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 26 '18 at 14:46









TriskalJM

1,74711318




1,74711318










answered Dec 22 '18 at 9:37









VonCVonC

854k30227243291




854k30227243291








  • 2





    What do you mean by more tightly linked?

    – Konrad
    Dec 23 '18 at 9:58











  • By binary dependencies you mean linking to pre-built static or dynamic libraries?

    – Konrad
    Dec 23 '18 at 10:00











  • @Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

    – VonC
    Dec 23 '18 at 11:12











  • @Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

    – VonC
    Dec 23 '18 at 11:13











  • I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

    – NetherGranite
    Jan 4 at 6:21














  • 2





    What do you mean by more tightly linked?

    – Konrad
    Dec 23 '18 at 9:58











  • By binary dependencies you mean linking to pre-built static or dynamic libraries?

    – Konrad
    Dec 23 '18 at 10:00











  • @Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

    – VonC
    Dec 23 '18 at 11:12











  • @Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

    – VonC
    Dec 23 '18 at 11:13











  • I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

    – NetherGranite
    Jan 4 at 6:21








2




2





What do you mean by more tightly linked?

– Konrad
Dec 23 '18 at 9:58





What do you mean by more tightly linked?

– Konrad
Dec 23 '18 at 9:58













By binary dependencies you mean linking to pre-built static or dynamic libraries?

– Konrad
Dec 23 '18 at 10:00





By binary dependencies you mean linking to pre-built static or dynamic libraries?

– Konrad
Dec 23 '18 at 10:00













@Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

– VonC
Dec 23 '18 at 11:12





@Konrad "tightly linked" means: you cannot modify the main project without modifying the dependencies. Recompiling everything is, in that instance, best.

– VonC
Dec 23 '18 at 11:12













@Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

– VonC
Dec 23 '18 at 11:13





@Konrad yes, pre-built, meaning you can make many evolution to your project but would need the same dependencies: no need to recompile everything in that case. Pre-built artifacts are enough, and can be declared in a small text file, then fetched from an artifact repository, as I mention in the answer.

– VonC
Dec 23 '18 at 11:13













I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

– NetherGranite
Jan 4 at 6:21





I actually didn't know that some package managers fetch packages during compilation itself! The only ones I've ever had experience with just add packages to the source the second you declare the dependencies.

– NetherGranite
Jan 4 at 6:21




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52256490%2fpackage-manager-vs-git-submodule-subtree%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Error while reading .h5 file using the rhdf5 package in R

Pushsharp Apns notification error: 'InvalidToken'