Best practice on sharing code between projects?

I find myself copying and pasting a lot between projects. Or exporting packages with systems in them.

I would like to maintain a library with scripts that update in all of my projects at once so I can have a framework of sorts.

What’s the best way to do this? I’ve seen git submodules and symbolic links suggested. What’s the best practice?

I haven’t tried it out yet, but 2019.1 seems to introduce the potential to package up your code and serve it via the Package Manager:

I personally maintain a separate visual studio project, and when I update it I have build scripts that compile it and then copy it to whatever projects I want updated with it.

I also have a ‘create project’ script that creates new unity projects with all my files layed out and generates the buildscript to be ran that updates it when necessary.

Mind you when I say “scripts” in this context… I don’t mean “unity scripts”. I mean just general bash scripts.

We have common code on a separate SVN repo and use externals to bring it into multiple projects. Not perfect, but has served us well for several years now.

These all sound like good approaches. I think I’ll try out the packages. Thanks!