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

Is someone using Git ?

Discussion in 'General Discussion' started by U7Games, Feb 23, 2015.

  1. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    Hi..

    I work alone on my project but, someone recommended me to use Control Version System...
    I was looking for SVN, but it needs a server that i don´t have.. I looked for a virtualServer for it, but the space is a bit limited and can´t to handle my project.

    Recently got Git, and .. I would like to know an opinion about it from someone with experience with this...
    The good news is that Git is free.

    http://www.git-scm.com/

    Thanks
     
  2. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    get a server. There's a big reason for that.

    An SVN acts as an easily acessible offsite backup of your project.

    I'm sure you can host it locally and run tortoise SVN off the same hard drive or somesuch, but i'm not sure what the point in that would be. I guess access to old revisions and code merging tools are still good.
     
  3. Deleted User

    Deleted User

    Guest

    I have my stuff at bitbucket https://bitbucket.org/ works great, is free with private repos and up to 5 people
     
  4. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    i share my project between office and home...
    i work in both place, i share via Dropbox... but i having some conflict of files.. and looked up to see if SVN or Git works better for me... in any case, do i must to have a computer all the time connected to internet right ?
     
  5. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    i'll check it element.. thanks
     
  6. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Gonna put in another recommendation for Git + Bitbucket. Github is okay, but a free account only lets you add public repos.
     
  7. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    525
    We use Git for KSP. We started out with SVN as well... I consider those the 'dark days' now.

    Git can work offline (unlike SVN). Your local copy is its own repo, and it doesn't have to be linked to a server, necessarily.

    I would add my +1 though, to getting yourself a github or bitbucket server. Never trust your work to a single storage device. Hard drives will fail. That's just something you have to live with.

    An alternative, if you simply can't go with an online server for some reason, is to clone your git repo to a second HD (like an external unit maybe), and set that up as a remote for your local working repo. You can then push/pull from that second repo just as you would with an online-hosted one. It adds at least one level of redundancy in case of storage device failure.

    Gotta love Git!

    Cheers
     
    McDirty, angrypenguin, Ryiah and 2 others like this.
  8. Raiden-Freeman

    Raiden-Freeman

    Joined:
    May 7, 2013
    Posts:
    15
    I've tried mercurial and team foundation server. Git is laughably better. Like so much better, that it's not even a competition.

    If you're new to git, it will LOOK hard to learn, but it's really not. It's just that most tutorials try to teach you stuff that you don't need. Atlassian (the company behind bitbucket) has a program called Source Tree that automates anything that you should need in Git, and provides excellent tutorials. If you just want to start using it, just go to bitbucket, and try to add an existing project. It will give you 3 lines that you need to paste to git's console (shift+insert, not ctrl+v), or you can use Source Tree(recommended).

    PS Also having your project on Git, means that you only keep it on your own computer. If you want to make sure that even if you lose it, it burns, etc, send it to the cloud by pushing changes to a remote repository on the Cloud. Two excellent services are bitbucket and github.
     
  9. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,390
    I use git, it works good when you set it up right (which isn't hard). Can be hairy for binary files. Coordinate whos working on what to avoid issues.. Sometimes large commits can hang but overall its a good experience.
     
  10. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    <fanfreakout>Um, I love your game. KTHXBYE</fanfreakout>
     
    Nanako likes this.
  11. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    I don't know about TFS, but I use both Mercurial and Git for different projects, and as of this date Mercurial has feature parity with Git as far as I can tell, including history edit a la git rebase. I'm curious to know what aspects of Mercurial struck you as laughably difficult compared to Git.
     
    Last edited: Feb 24, 2015
    angrypenguin likes this.
  12. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    If a person works alone, nobody can forbid him to have the server on his own machine and work with no network connection.

    For example:
    * https://www.visualsvn.com ― SVN server + very nice SVN client plugin for Visual Studio
    * http://tortoisesvn.net ― standalone graphical client

    ---
    I personally use Mercurial:

    * TortoiseHg as a graphical front-end. No idea why some people use the command line interface. There are also SmartGit/Hg and SourceTree. All of them are free and support both Mercurial and Git.

    * BitBucket as a backup storage (unlimited free private repositories, maximum 2 Gb each)

    * VisualHg - a plugin for Visual Studio which helps to mark files I rename inside VS as renamed, not as deleted and newly added. It's the only reason I use it.

    I failed to find any good explanation of practical differences between Mercurial and Git, so I just flipped a coin.
     
    Last edited: Feb 23, 2015
  13. U7Games

    U7Games

    Joined:
    May 21, 2011
    Posts:
    943
    Im "trying" to learn SourceTree with Git following this tutorial:



    But, it only explains just a littler section about the system...
    i followed it, and then.. dont know how to check changes from the other side...
     
  14. minionnz

    minionnz

    Joined:
    Jan 29, 2013
    Posts:
    391
    Not sure about SourceTree, but generally you'd have something like this:
    1 - a Git repository server hosted offsite
    2 - a local git repository (usually created automatically)
    3 - Your code

    One of the advantages of Git is that you also don't need #1. If you don't care about offsite backup and you only want change/revision control, then using a local repository only is perfectly fine.
    You work as if your local repository is your source control server. You make changes, commit to it, add notes, branch/fork from it etc.

    Then you have the option of "pushing" your changes to one or more remote repositories (#1), where it will sync your local changes with the server.

    Others users can then "pull" your changes from the server into their own repository.

    This is the main advantage of Git. Most source control systems have an authoritative/master source repository that everyone is attached to - that's not the case with git. Git is built a little more like P2P - you can push/pull to any repository/fork (provided you have authorisation of course).

    IMO, this makes it easier to setup and use. You don't need to worry too much about branching/forking strategies. You just initialize/fetch a repository and start working.

    Edit: Here's a good link that does a better job of explaining what I was getting at - http://geekaholic.github.io/blog/2012/05/14/git-on-p2p-development/
     
    Last edited: Feb 25, 2015
  15. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,522
    Bitbucket is great, though I suggest checking out their terms and making sure your project is a good fit. Mine aren't, and they're fairly typical of game projects. I moved to Unfuddle instead for that sole reason, and I'm finding the service there to be great as well, and the price is pretty reasonable.

    Of course, BB's terms may have changed since I moved.

    Me too... when I trialled both for work a few years ago I couldn't find any practical differences to set them apart.

    They'll forbid it of themselves from the day a HDD dies or the computer is stolen or the house burns down and they lose all their data...

    I have a USB stick on my keychain which I use to make backups whenever I'm working away from a network connection. Unless something is a throwaway, it's probably worth backing up.
     
  16. Samuel411

    Samuel411

    Joined:
    Dec 20, 2012
    Posts:
    646
    I recommend using bitbucket and sourcetree for GIT purposes. They are very easy to learn. As far as backups, every night I commit to bitbucket and make a local backup of my game on my HDD, every week I make a backup on my USB as well. That flash drive is hidden away in a cabinet. You can never be too secure.
     
    Last edited: Feb 25, 2015
  17. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    +1 for bitbucket + SourceTree.
     
  18. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    I had issues when I tried using SourceTree, it freezed the moment I started it up, and would take forever to analyze changes in the git folder. Can anyone recommend any other git GUI?
     
  19. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Don't really have any experience with it but this one looks very nice https://github.com/blog/1127-github-for-windows
    It's meant primarily for GitHub but I know you don't NEED to use GitHub

    Also here is a list http://www.git-scm.com/download/gui/win
     
  20. Samuel411

    Samuel411

    Joined:
    Dec 20, 2012
    Posts:
    646
    http://tortoisesvn.net/ I've used tortoise before and found it useful but source tree just had a nicer looking UI lol
     
  21. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,138
    I do the same, works great.
     
  22. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    If you haven't used it for a while, it may be worth another look. It was all over the place at one time, but I haven't had any issues with it in the past couple months, it's quite stable.


    Re hosting yourself vs. 3rd party; you get to use Cloud Build if it's a 3rd party service.
     
  23. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    Smart Git/Hg. Rock solid and comprehensively covers all of Git features. It also doubles as a fantastic Subversion client, allowing you to have all of Git's merg-y goodness on the client side while keeping your code in Subversion on the server side.

    The interface is a bit too Eclipse-y for my taste, which for me meant that it took me a while to unlearn my gag reflex. But it was worth it.
     
  24. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,822
    I use Git on a daily basis, with github as the place I commit to. For reference, one of my past projects can be found here.

    One thing to note, though, is that git naturally works locally; when you commit a changeset, it will save against your local repository. From there, you push to a remote repository. If you so desire, you can commit some changes to your local repository, but back out by pulling from the remote repository (I had to do this once, because I borked some changes.)

    I use TortoiseGit, which embeds itself directly into Windows for you. It's really quite convenient.
     
  25. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Thanks guys.
    I started using tortoise, but I too was looking for a better UI :)

    I tried it about a month ago. If I recall correctly, it wasn't updated since august, and I've read some gossips that they might be abandoning the Windows version.

    Yeah, I was considering Smart Git, but I decided to start with a free alternative. Maybe I'll get a license at some point...
     
  26. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    We are having a heck of a time trying to use Git for a project. I use SVN at my current company (not game related) for our projects and the branching/merging process and such are very familiar but for some reason we are always ending up with some corruption in our project. We have had to constantly remove and re-add assets to get them to connect to each other after a branch merge (this is on BitBucket, btw). It doesn't do us a lot of good to have to do this every time. Does anyone have any tips? I am wondering what all files we really need to sync because as it is now we are losing many hours with Git and having to set assets back up after a merge. Does anyone have a simple Unity specific Git setup they could share?
     
  27. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,822
    How often are you merging branches?

    Generally, in Git everyone should be working from the same branch, unless you have a solid need to branch your repository (e.g. an experimental build that deviates some feature from the trunk somehow.) My use-case is a little bit less common, but generally in my projects, I have different branches for different, but related codebases. For instance, in my current project, my jrpg branch is the current branch I work from; the 'master' branch is the old, abandoned sidescrolling version of the game. The 'gh-pages' is a branch that determines what github hosts on the project's IO page.

    If everyone is spinning off their own branch, yes, you're going to have merges, and merges always suck. That's why you control the amount of merging you have to do.

    Using version control on a team does require a degree of discipline, and the team buying into a set of conventions, for the benefit of the team and the project; for one thing, you generally want different people to be working on different files. If people are going to be working on the same file, there needs to be coordination/communication such that you don't have to resolve a conflict.

    For the uninitiated: Version control is not a panacea, and doesn't preclude all problems. It's a supremely helpful tool to allow multiple people to work on a project at the same time, while removing most of the problems that occur by way of having multiple people touching a common set of files.
     
  28. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Merges shouldn't suck. We do feature or issue branches so that items can be branched from the Dev branch then finally merged to a release branch when they are stable. Basically we do the standard setup with the development branch as our current code base, then if a developer has to work on an issue/feature/change they will make a branch from there and work on their code. Once done they will merge from the dev branch back to their branch to bring in any changes that have happened since they branched, then perform a merge from their branch back to the dev branch once it is verified to be ready to push. Same process I have been using for 5+ years with SVN and multiple projects without any issues. For some reason with Unity it makes the assets go nuts once in a while. We do diff checks on the files and nothing seems amiss but it still causes a ton of issues.

    Realistically working ONLY in the main branch is a disaster waiting to happen. I have seen it before while working with multiple coders on projects. One screw up and the project has to be reverted to a point before several pushes happened and then each person has to diff and find all their changes and reapply them.

    Are you doing pushes directly to the dev branch for all coders? I think my years of SVN may be twisting what I am expecting to happen. At this point I am about to set up an SVN server to see if the issue happens there as well.
     
  29. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,615
    Hm, I use both Git and Mercurial extensively on both code-heavy and art-heavy projects and most of the time my merges go fine...

    If the assets are going nuts, my checklist would be:
    • Project should be set to Force Text serialisation.
    • VCS mode should be set to 'Visible Meta Files.'
    • All .meta files should be committed along with their assets.
    • The 'Library' and 'Temp' folders should never be committed.
     
  30. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,522
    Yeah, we do what @superpig says and it's rare to have merge issues.
     
  31. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I am going to make those changes (I think they were already set for visible meta files) and see if that helps. I know we are already excluding the Lib and Temp folders. I was afraid that might have been part of the issue. We shall see! Thanks for the info.
     
  32. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    Sad thing is if your project is too large you can't host it on bitbucket. (1GB limit)
    SourceTree could be nice if it had a progress bar when pushing/commiting changes.
     
  33. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    I've not heard any rumours, but it's not like I keep my ear to the ground in CVS land; there have been two updates in the past month, if that means anything anyhow.
     
  34. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Heh, just checked out their blog, and here's a post from yesterday that covers exactly that :)
    https://blog.sourcetreeapp.com/2015/02/25/were-just-getting-started-with-sourcetree/
    With the new updates, I should probably try it out again.
     
  35. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,138
    oh didn't know that not good :-(
     
  36. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    1Gb is a soft limit. When you reach it you'll see a notification on your repository's page, something like "Dude! Have you no shame?" And if you have no shame you can continue to push up to 2Gb.

    https://confluence.atlassian.com/pages/viewpage.action?pageId=273877699
     

    Attached Files:

    Last edited: Feb 26, 2015
  37. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    I have a little issue with SmartGit/Hg. I can't convince it to ignore a couple of files in my project folder. When I press Add, it constantly tries to add them to the repository.

    TortoiseHg and SourceTree work fine.
     

    Attached Files:

  38. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,109
    I'm moving from using TFS to Perforce as it has plugins for a few different IDEs (including Unity).... so far I really like it.

    They've also got their own clients (like source tree), and I like how they've open sourced their plugins. The "free" version supports up to 20 users and integrates with LDAP services (which is nice).

    I've run into a couple quirks with the Unity plugin, but as long as I'm not doing "too" much outside the editor it seems to be alright... also syncs with the VS Unity Tools.

    anyway, the server I'm running it on is a virtual machine, and barely takes any system resources at all so if you're looking to try something, give it a look.
     
    angrypenguin likes this.
  39. tyoc213

    tyoc213

    Joined:
    Nov 14, 2011
    Posts:
    168
  40. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,138
  41. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    Per repository (you could have multiple repos per project, as some people do)
     
  42. lorenalexm

    lorenalexm

    Joined:
    Dec 14, 2012
    Posts:
    307
    If you are making use of a Mac, I can highly suggest the Tower client for a Git GUI - it's not free but nor is it very expensive. I've been using it for the better part of a year, and would have a hard time justifying a switch to another platform.

    I also see many of you talking about the services such as BitBucket, GitHub, Unfuddle and the likes, but I don't see much of any mention towards running a self-hosted git instance using the likes of Bonobo, GitLab, or even just a pure installation of Git. Is there a general consensus against running ones own server, or is it more to the fact of using an already proven infrastructure?
     
  43. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
  44. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    Thanks! I've heard good things about the Tower, but unfortunately I'm not using a Mac.
    As for self hosting - someone already mentioned this earlier, but do you do if your HD fails? With Bitbucket and similar services you've got regular backups, etc.
     
  45. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    We've been using Plastic SCM ( https://www.plasticscm.com/home.html ) for over 2 years now...

    Never looked back. You adapt it to whatever workflow (CVCS, DVCS) you want, even use it with a Git repo and there's a Unity Plugin for it as well.

    And it's free for individual users / non-profit teams.
     
  46. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Speaking of HD failure:

    We only keep the code and a few assets in Git, the other larger items (mostly that damned texture folder and other binary items) are kept separate, so I have a multilayer backup in place. No single point of backup will 'save' you, but having multiples might. My personal setup us a RAID 1 for the working drive (256gb), a single drive copy of the working drive (that is removable) that does a backup every night, a RAID 1 backup (1.5tb) that holds 7 days of the project drive (removable grab-n-go setup), and a RAID 10 NAS (in a fire resistant safe) that holds a copy of the 7 day backup with a few monthly versions saved as well. Nightly that all gets sent to a backup offsite where it holds 30 days of the project drive daily backups. Each backup is a full snapshot and not a diff, so we can pull any one of them and have all data restored from that point. Also, each drive set is encrypted, so someone stealing them would be annoying but would not give them our project/assets.

    Just realize that using only Git will not save you from a HD failure or disaster locally. Also, don't forget to back up all of your design docs, emails about your game, etc. You never know what all you might need, so invest in a separate drive that you can use just for the purpose of your project(s) if at all possible. I also keep copies of assets from different dates and download times. I have found it useful in narrowing down issues if an asset changes to have an older version on hand that is known stable. This usually is handled inside of your source control as well, but call me paranoid for keeping the asset package too.

    Anyhow, back on topic. We are going to be doing some testing with Git this week to see if the above changes are our issue. Hopefully that is (was) our problem. We had looked at PlasticSCM about a year ago and it was a real pain to work with then. It seems they have done some work to it since then to be more game friendly. If I recall, our SysAdmin did not like it for some reason and kaboshed the implementation.

    We have also had a ton of issues using SourceTree, from random lockups to complete failures needing a reinstall of the client. Most of our work has been through TortoiseGit and seems to be doing fine for us.
     
  47. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    May I inquire as to what was the issue specifically? I've only had joy and bliss with PlasticSCM and I work exclusively with big assets, artists and scene compositing... you know, the trifecta of VCS problems.

    I'm constantly checking to ensure we didn't shot ourselves in the foot, but so far, it's been the perfect solution (and great service from Codice software).
     
  48. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    It was a decision on the Sys Admin's part and I have no idea what it was. All I recall was that the install went anything but smooth and support was apparently no help. I don't know what the actual problem was but it caused us to drop the idea of implementing it.
     
  49. lorenalexm

    lorenalexm

    Joined:
    Dec 14, 2012
    Posts:
    307
    I should have elaborated a bit further as per my definition of self-hosted. The Git repositories, save for local of course, isn't running on my workstation but instead in the local server rack in a RAID 1 setup, then weekly backups are pushed to a colocated server which keeps the last 3 months of weekly backups. As @CaptainMurphy this only protects the project's direct assets, for all other day-to-day assets we use the same setup for our SmarterMail and StackSync servers albeit backups are preformed nightly with these files.

    That being said, there is still a chance that the workstations, local and colocated servers all fail at the same time. If I were to get this unlucky though, it would probably be a sign that it's time to close up shop and get a job as a clerk somewhere ;)
     
    Devil_Inside likes this.
  50. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    511
    I used BitBucket before but then switched to Visual Studio Online, since it has no limit on repository size (my project is 5gb currently) which is extremly good for Unity projects and is free. It also works with Unity Cloud Build with some tricks. Locally I use Tortoise Git to manage the changes which very nicely integrates into the Windows Explorer. I can really recommend this combination.