How to share and reuse code in team?

Currently, i am finding a way to easily share and reuse code internally. The easiest way of course is to hold a share folder and put all reusable resource into it. But it’s not good for search or version control. Symbolic Link is not a good idea because it may get a situation that a new script doesn’t work in an old project. I would like the developer need to manually click something to update the resource. Creating Git Repository for each script feel like overpower (I am using git for verison control of projects). The ideal way is to have something like an internal simplfied asset store, every resource can link to some description or even screenshot.

Is there any suggestion you can give me? Or i have to make my own tool?

BitBucket + SourceTree

If you think version control is overkill, it’s not. It’s the best way to see who changed what, where, and when. If something breaks upon integration, you will know where it breaks.

so one repository per script? I am version control for the project, but i am thinking about reuse of individual little script files. I hear that some people like to have a folder of all shared resource and make it a git repository. but i still doesn’t feel good about it. Also i need to find a way for searching and something to read before importing to new projects. i even thought about hosting an internal wikia.

i even thought about NuGet. but it doesn’t looks like suitable for unity.

We use SVN externals for common code required across multiple projects. Each project has it’s own SVN repo and the externals add in the common code as required.

Firstly you should define what exactly do you want to share.
If it’s a code, then Git or any other SVN is enough suitable (one repo for all code).
If you want to share whole game project, scenes or assets (like images, music and so on) you also can use SVN, it’s not so convinient but possible too. But better solution here will be Unity Collaborate, I guess.

And, plz, forget about shared folders - if once one guy delete all data there, other will kill him at the next day =)

this

If you’re just wanting to share ONE script at a time, pastebin is an option, thought why aren’t you doing version control on all of your code?

Two repositories. One for shared code and one for the rest of the project.
There’s also “Git Submodules”
https://git-scm.com/book/en/v2/Git-Tools-Submodules

To many repositories will leed to repo-hell :slight_smile: Hard to update, hard to reuse and a lot of duplication. What if one script could use part of another?

I think better is to place all these scripts in one repo (some kind of Team’sBestPractices repository), and connect it as submodule (as @neginfinity said). You will be able to use any of these scripts, and, I believe, Unity will include in build only used of them. All you need in these case is just correctly organize folders structure for your Team’sBestPractices repo to avoid mess. As bonus you will get a full version control for all scripts.