Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Is there a non-cloud-based version control option?

Discussion in 'Editor & General Support' started by Marscaleb, Apr 19, 2021.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    I'd like to use some version control software to keep all my project files current between different computers.
    However, all the programs I've seen have limits for how much data you can use, and unless I'm paying a crap-ton of money that space already rivals the current size of my project.

    Is there some other option for a program that will keep files up-to-date between my computers, but perhaps that doesn't backup everything on a cloud server?
    Like one that will just directly copy the changed files across the network?
    I don't need to backup everything to the cloud (although I would be fine with doing this for some select files) but I just want to have all the assets and stuff copy over from one computer to the other.
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,920
    https://www.visualsvn.com/server/
    https://www.linux.com/training-tutorials/how-run-your-own-git-server/

    And there are others for any OS.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,779
    I use Bitbucket, Github and Gitlab variously. They are all free and they all will happily handle 1gb of repo size, up to even 2gb. Github has some individual file size limitations. I would stay away from committing lightmaps, as a) they are useless to version, and b) they get massive.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I have servers rented for testing my dedicated server game, and I just place my SVN server on one of them. So the version control is effectively free with no arbitrary repo size limits. Previously I've set up a local computer as an SVN host, and used dynamic DNS and port forwarding for remote access, but that is only needed if you do a lot of work remotely.
     
  5. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,724
    Yep just run your own git remote.

    Any computer that has:
    - Git
    - SSH

    can act as a git remote.
     
    Joe-Censored likes this.
  6. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992


    ...What would probably be the easiest method to follow?
    I really just want to keep all the files up-to-date between two different computers. Backups might be nice, but really I just want an ability to push the changes made on one machine to another.
     
  7. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,920
    If you're willing to rethink your stance on cloud storage, I really-really (REALLY) recommend Azure Repos from Microsoft. All you need is a MS account. It is free, as of today, they offer unlimited storage, LFS included and some basic project management tools as well. It worth a look. This way you don't have to deal with any servers yourself. You just use a git client either from the OS of your choice or even from your code editor (visual studio, vs code, rider, whatever handles git)
     
  8. BenniKo

    BenniKo

    Joined:
    Mar 24, 2015
    Posts:
    100
    If you want to install your own git server I recommend Gitea: https://gitea.io
    Because it is easy to setup and the webinterface
    is great.
     
    Ziplock9000 likes this.
  9. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    I had no idea Azure Repos was free. I've only used it within my company and just assumed it was part of an Azure cloud services subscription.

    Yeah, I'm seconding it being really good as well.
     
  10. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    I'm looking into this, and the "Free" account only offers 5GB of storage for 12 months.

    My complete project is already at 10 GB. And I'm not looking to use version control just for my code, I just want a method to keep all my files up-to-date between two computers. Not just scripts but also my scenes, my textures and materials, the prefabs I update. On top of that, all the system files and project settings that I don't directly update and know that I am changing.

    I'm not opposed to using a cloud-based service, but keeping all these files updated has yet to appear economically viable for me.
     
  11. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,920
    I'm not sure where you are getting this from, but I was reading the Azure Devops page where they are stating that unlimited private git repos is part of the package and it's free up to 5 users.
    https://azure.microsoft.com/en-us/pricing/details/devops/azure-devops-services/
     
  12. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,779
    As I wrote above, I've been using Bitbucket since 2012 and haven't paid a red cent.

    I've been mirroring to Gitlab and Github since about 2018 or so and same free as in beer.

    I have a few public repos but 99% of my stuff is private repos.

    You are literally describing EXACTLY the function of source control. We use
    git
    with a 25-person team every single day, with artists, engineers and designers all manipulating our team's eight or so different game repositories.

    Our company DOES pay a red cent because we license the full Bitbucket suite for local hosting. You do not need this as long as your total repo size stays under 2gb and your individual file sizes are reasonable.

    And as always with git, if you don't want to use cloud then just push and pull your repositories to a thumb drive, move it around and off you go, all tracked and versioned with history leading back to day 1 of your project. It's really something I could never work without ever again, and once you realize the true power of good source control, you won't want to work for a minute without it.
     
  13. IVANMARTINEZ94

    IVANMARTINEZ94

    Joined:
    Aug 2, 2017
    Posts:
    10
    I'm using Azure Dev ops for last 4 years It's free and the size of my git repository is 34gb, I upload all ( textures, 3d models, sound effects and music...) the complete project its on git except the library folder and the common temp files.
    The only limitation is that can not upload more than a 5gb in one commit.
     
    Lurking-Ninja and Kurt-Dekker like this.
  14. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    Okay, I didn't want to come back here for this because this form is for Unity, but I can't seem to find anything on Microsoft's sites that are any help.
    I'm trying to set this up, but I can't figure out how to get started.
    I made an account and I created a project.
    When I go to the "Repos" page and look at "files," I don't see an option to just upload files or any such thing. I see options to link to existing repositories.
    How do I actually get Repos to connect to the files on my computer? And how do I get it to connect on a second computer and pull those files as necessary?
     
  15. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,920
    If you have an existing project, the best way I know is this:
    - please make a backup, it's important
    - shut down unity or any other editor software for now
    - clear out the <folder> you want to use as repo (I know, make sure you have backup)
    - remove the <folder>
    - go to the https://<your-organization>.visualstudio.com/_git/<your-project> (essentially go to the files)
    - initialize the repo with a readme or something (doesn't really matter)
    - when you're done you need to clone this repo onto your computer through some git software, use the <folder> path
    - when you have the <folder> with the initialized readme in it, add your files back
    (I'm not sure if they have commit size restrictions, if they have, please keep in mind that you only can submit limited gigabytes)
    - set your .gitignore file properly
    - commit & push with proper commit message
    - rinse and repeat until all your existing project is committed
    - from now on you can update / pull / commit normally
    - if you need your repo on other computer you can clone your project normally
     
  16. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    I do not understand this part.

    I think I understand that this is where I tell the azure site that I want to put this project on my computer, and where I am telling it to put it "happens to be" the same folder location that Unity looks for my project in. (And in the next step I fill that folder with all my assets and things I backed up.) That much makes sense to me.
    But I don't understand the actual how-to here.

    If I click the button that says "clone" it gives me an option with a command line with a web address, not a folder location on my computer.

    And you say "through some git software," am I supposed to be using another program here to handle all the Git... stuff? I thought that's what this Asure DevOps was doing. If I need another program then I don't know where to start with that.
     
  17. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,920
    Yes.
    JetBrains Rider, Visual Studio Code, Visual Studio are all capable of handling git version control with proper plugins.
    You can use specialized software like SourceTree if you want. Or you can do it from command line of course. It is up to you and teaching how to handle git version control is a complex topic, I'm not the best guy to do that. I'm a crappy teacher. :)
    You can find plenty and various online tutorials how to use git software in general or any of the above.
     
  18. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    992
    Well, I've started using Visual Studio for this, since it was handy.
    I'm still waiting for the first of several large pushes to complete, so I guess we'll see how things go.
    But right off the bat, I'm rather annoyed by the process. I thought I was just going to have to to a site for Azure and click a link to say "push" and then "pull" on the other computer. But I have to explicitly start VS and go into settings I'm not used to (and how is this going to mesh with the other things I need to use VS for?) and I don't seem to have a simple one-command to get it to push something.
    So I'm open to any suggestions for a simpler option to use instead of going through Visual Studio.
     
  19. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    The Git CLI tool is the typical way to go about it.

    To start off:
    git init
    -> initializes a local repository on your PC at the current directory, with a branch named "main".

    To link your remote repository to your local repository, head back to where you got your repository's URL here...
    ...copy the address, and run the command:
    git remote add origin <url>


    "origin" is just a nickname for your remote repository, and you can technically replace it with whatever name you want to call it. It's just that "origin" is usually what people call it.

    To pull your remote repository's files into your local repository, run:
    git pull origin <branch-name>
    .
    Your remote repository likely also has a "main" branch, so just replace "<branch-name>" with "main".

    To push your local repository's files up to your remote repository, first stage the files with the changes you want to commit using:
    git add <file-name>

    (You can skip this step if you want to commit all changed files instead of individual ones.)

    Then commit your changes using:
    git commit -m "your commit message"


    And finally, push your committed changes to your remote repository using:
    git push origin <branch-name>


    That's about the gist of syncing up changes between your local and remote repository.

    Here's some more info about using Git:
    https://www.freecodecamp.org/news/learn-the-basics-of-git-in-under-10-minutes-da548267cc91/
    https://www.atlassian.com/git/tutorials/setting-up-a-repository

    Also, right of the bat, you probably want to add this .gitignore file to the root of your Unity project:
    https://github.com/github/gitignore/blob/master/Unity.gitignore

    A .gitignore file is, as its name implies, a way to tell Git to ignore some files/directories, excluding them from repositories.

    In Unity's case, you don't need to include things like anything under the /Library, /Temp, and /Logs directories, since these things are auto-generated by Unity and aren't directly related to your project's development.
    Including them is just a waste of space in your repository.
     
    Last edited: Jun 20, 2021
  20. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    I've been using this for ~2 years with LFS and many GB of data and it's flawless.