3 ms·
Please help me figure out the best way to share code between Github repositories... I love C#, and I acknowledge Github as the king of source control. I make
by VikingCoder 1y ago
Please help me figure out the best way to share code between Github repositories...
I love C#, and I acknowledge Github as the king of source control.
I make a new Repository a couple times a week, and use Visual Studio Code to clone it, and open a terminal and "dotnet new gitignore" and then use dotnet to make new projects all over the place...
On multiple machines, even. On a VM on my NAS. On my Windows machine. On my Windows laptop. On a VPS.
And I'm happy.
But how in the holy hell am I supposed to share code from one repository to another?
I want to make VikingCoderLib as a C# library (classlib), and drop in all of my favorite Extensions for generics and strings, and etc.
And then make another classlib for some of my Protocol Buffer utilities. And another classlib for setting up a terminal.js console for an app. And...
What's the best way to do that?
Submodules?
They really seem to suck. I can't easily make changes here, and use them there, without it being a huge pain in the rear.
Am I doing this wrong? Am I missing something?
- wsc981 1y agoI don't mind submodules much. I mean when I first used them I thought it was sucked, but now I use it all the time for personal projects. I like to make small Lua libs or fork existing Lua libs and include those in a lib directory in my LÖVE / LÖVR projects. Works fine for me. Perhaps the only thing that sucks a bit about submodules, might be if you work with multiple people and some reference of a submodule is updated and you need to go into the submodule directory to update the reference locally. But I think that's the only thing, no big deal. I don't think you deal with this issue much when you work by yourself on a solo project, on a single machine.
- coffeebeqn 1y agoMonorepo?
- VikingCoder 1y agoI hate that you're almost certainly right. It feels like there should be a good way to have a dotnet classlib in one repository, and use it from others, but it just doesn't feel like they fit together the way they should.
- iFire 1y agoYou can also see my workflow for patching godot engine so it's mergable on a rebased master or stable release. > This project uses git-assembler to simplify merging patches on top of the latest stable release by allowing each patch to be in a separate branch, so they can all be merged into a fresh branch without complicating the revision history. https://github.com/KeyboardDanni/godot-for-sidescrollers https://github.com/KeyboardDanni/godot-for-sidescrollers I'm https://github.com/fire https://github.com/fire
- jbjbjbjb 1y agoMake your own packages for your extensions and pull that packages into your projects that need to reference those extensions.
- VikingCoder 1y agoAnd set up my own nuget repo? I want my code to be private...?
- jbjbjbjb 1y agoYes you would set up your own nuget feed and publish as part of your build. You can set up the nuget feed on your own machine, use something like Teamcity or GitHub packages.
- unclad5968 1y agoHow does any other language do this? I bounce between submodules and monorepo for hobby projects and both approaches have some issues. I'm not a git expert so working with monorepos are a little easier to work with for me.
- iFire 1y agoI use git subrepo to make a monorepo.