Wojtek Wencel
Wojtek Wencel

Reputation: 2117

How to set up git for game development with Unity?

I'm starting to work on a project and need to figure out what's the best way to do version control right now. There are a few things I'm not sure about:

What's the best repository hosting service for Unity right now? I thought about using Bitbucket since it has 2GB hard limit for repo size and 10GB for LFS for free. I've heard that many people recommend Gitlab as well, but I can't figure out what the specific limits for repo/LFS are and how expensive additional storage is.

In this post from reddit it's suggested to use the .gitignore file from github but also that When you add something to gitignore, it doesn't ignore the associated meta file. But the .gitignore file contains these lines:

# Unity3D generated meta files

*.pidb.meta

*.pdb.meta

Won't this exclude all the mata files?

It's also recommended to use SmartGit instead of GitKraken and Github desktop. What about Sourcetree? Also I've heard that Gitkraken has gotten a lot better recently, can somebody confirm if it works for bigger projects?

Also this point form the post: When you add something to gitignore, it doesn't ignore the associated meta file. How important is this? Should I really care?

Upvotes: 2

Views: 1394

Answers (1)

Jimmar
Jimmar

Reputation: 4459

This is a very opinionated question, but I'll try to answer some of the questions.

What's the best repository hosting service for Unity right now?

That depends on your needs and usage, but switching from a service into another is not a hard task so just pick whichever you feel comfortable with and use that, or try whichever one since both Bitbucket and GitLab are pretty good and you are looking for the free tiers anyways.

In this post from reddit it's suggested to use the .gitignore file from github

I usually use https://www.gitignore.io/ to generate gitignore files, you can add your IDE too [Rider or Visual Studio for example] and it'll combine the gitignore for both. If you want more info about how gitignore works then I suggest reading the answers here What is .gitignore exactly?

Won't this exclude all the mata files?

No, This will only exclude the meta files that ends with pidb.meta and .pdb.meta.

It's also recommended to use SmartGit instead of GitKraken and Github desktop. What about Sourcetree? Also I've heard that Gitkraken has gotten a lot better recently, can somebody confirm if it works for bigger projects?

Again very opinionated thing, I've used SourceTree for a long time and recently switched to using Tower which I'm liking so far.

Git Kraken seems to be popular but I couldn't get used to it myself, start with whichever appeals to you the most and change if you didn't like it.

Also this point form the post: When you add something to gitignore, it doesn't ignore the associated meta file. How important is this? Should I really care?

This just means that if you decided to ignore a file, Unity would still create the meta file and they would get pushed [if added to git], so just add the meta file too to your .gitignore, if you don't add anything to .gitignore on your own then you don't have to worry about this.

Upvotes: 1

Related Questions