How to Setup Github with Unity the Right Way

Поделиться
HTML-код
  • Опубликовано: 30 июн 2024
  • Hey guys - a quick tutorial today on setting up and using Github for Unity.
    =====Resources=====
    Github: github.com/
    Github Desktop: desktop.github.com/
    =====Credits=====
    lukrembo: early morning in winter:
    • lukrembo - early morni...
    lukrembo: hot mocha:
    • lukrembo - hot mocha (...
    lukrembo: tea cozy:
    • lukrembo - tea cozy (r...
    lukrembo: wintry street:
    • lukrembo - wintry stre...
    =====Chapters=====
    0:00 Intro
    1:12 Create Github Account and Download
    1:24 Creating your first repository
    1:52 Cloning your first repository
    2:46 Creating your Unity Project
    3:11 Combining Unity with Github
    4:10 First Commit and Creating your first branch
    5:39 Merging your branch
    6:20 Discarding changes
    6:38 Outro
    =====Tags (ignore)=====
    #gamedev #tutorial #github #versioncontrol #unity2d #unity3d #unity #unitytutorial

Комментарии • 34

  • @antonjagers3572
    @antonjagers3572 3 месяца назад +3

    Thanks a lot! I followed a other tutorial where I got like 16k files to commit. I'm glad this one has only 28 to commit.

    • @GarnetKane
      @GarnetKane  3 месяца назад

      Amazing! So glad to help - yeah I found a few tutorials on this topic actually didn't cover it accurately and it didn't recognise the git ignores correctly!

  • @jhonuribe171
    @jhonuribe171 4 месяца назад +1

    tnhks bro! Easyyyyy xD, Greetings from Colombia - Cali

  • @Yukiixs
    @Yukiixs 6 месяцев назад

    I was thinking that you were going to cover Ci/cd as well, unity recently disabled activation of the personal editor inside docker container, which makes CI/CD really harder to setup for free projects ( in order to promote their own solutions ).
    Ci/cd allows to automatically build the game, test it, publish it, make static analysis of the code for styling, security,.. rules and opens issues for you… a must have in teams projects

  • @MM-wr2kj
    @MM-wr2kj 4 месяца назад +1

    thank you

  • @RKelly694
    @RKelly694 4 месяца назад +1

    Hey, this was a brilliant tutorial that worked for me so thank you!!! Just a quick one, i added some code in one of the scripts, then when i look in my repository of the git deskop it didn't show any changes that i can commit? Any advice on what to do. Again, thanks for the brilliant tutorial, i followed a few but none were even close to this!

    • @GarnetKane
      @GarnetKane  4 месяца назад

      Hey! Interesting; the only thing I could think is that the scripts/assets folder wasn't copied over? Otherwise just ensuring the script is saved would be the other obvious answer?
      Let me know if you still have this problem or if you've got a work around, would be interested in hearing what happened!

    • @RKelly694
      @RKelly694 4 месяца назад

      @@GarnetKane so what’s happened was after installing git, I had placed the .gitignore file in the wrong folder. After moving it to the folder containing the unity project files, it started to work!! Also, thank you for getting back to me about the question. I do appreciate it. And I’m still going through your unity project tutorial, it truly is brilliant!!

  • @ryanwinchy
    @ryanwinchy 4 месяца назад +1

    Hey Garnet! Version control for game dev has been something I've been struggling with for a while. The files are just so big and my .gitignore seems to never work. I'm trying to use Github LFS now.
    Is it good practice to VC the project as a whole with all assets, or just the scripts? Just scripts would be a whole lot easier lol!

    • @GarnetKane
      @GarnetKane  4 месяца назад +1

      Definitely would be easy to just have the scripts but it's definitely recommended to do the whole project unfortunately! There's heaps of meta files that would be required and just doing the scripts would probably result in a bunch of conflicts

    • @ryanwinchy
      @ryanwinchy 4 месяца назад

      @@GarnetKane thanks, I got it in the end! I just had to figure out LFS :)

  • @hermitcat332
    @hermitcat332 21 день назад +1

    Holyfuck this is all I needed

    • @GarnetKane
      @GarnetKane  21 день назад +2

      Glad it was helpful! Honestly surprised that there wasn't a better tutorial already existing or one that was as straight forward hahaha

  • @countotuscany7061
    @countotuscany7061 5 месяцев назад +2

    So are you pushing everything onto GitHub? Including binaries, assets, textures, sounds, models etc?

    • @GarnetKane
      @GarnetKane  5 месяцев назад

      Yep definitely - i could be wrong but I think from the git ignore, binary files are ignored, but definitely the rest of them you want to push up.
      Any file that appears in your Github Desktop Application you want to push up (assuming you want to keep those changes)

  • @Iamjake1000
    @Iamjake1000 16 дней назад +1

    This is good, but if your project gets big enough don't you have to pay? How can I just run this locally? Was using unity's version control but I can see that bill becoming huge quick..

    • @GarnetKane
      @GarnetKane  12 дней назад +1

      Hey! There’s definitely a paid aspect of github, and github itself recommends projects that are between 1-5gb, but depending on what your purpose is, you’d rarely be going over that limit anyway. Using the git ignore definitely helps as well as it removes unnecessary storage/files that could clutter up the repo. I’ve been using github for all my personal projects for the last 5+ years, all ranging in sizes but i’ve never come across anything where the project files were too much for Github to handle - all on the free tier as well!

    • @Iamjake1000
      @Iamjake1000 12 дней назад +1

      @@GarnetKane thank you, I'll give it a try with the project that was giving me issues with unitys version control

  • @duhanavc6773
    @duhanavc6773 3 месяца назад +1

    Thak you for explanation. How often should we push? I am begginer so I dont know I dont wanna push any small change I made

    • @GarnetKane
      @GarnetKane  3 месяца назад +1

      Hey! Good question - I would say, conventionally when you’re working in a studio, you will always push what you’re working on at the end of the day to ensure you don’t lose progress. But on top of that, whenever you’re working on a new feature/piece of content that you think is ready to push before you start working on something else, then would be a good time to push up the changes as well.

    • @duhanavc6773
      @duhanavc6773 3 месяца назад +1

      Thanks. I think I got it. I am afradit that if I push so many times it will look bad and bulky in github but I think no need to worry about it

    • @GarnetKane
      @GarnetKane  3 месяца назад +1

      @@duhanavc6773 oh yeah for sure! Don't worry about cluttering up the github commit history at all - it would definitely even be considered better so that issue tracking becomes a lot easier!

  • @HailScreaM77
    @HailScreaM77 5 месяцев назад +2

    this does not work for us, i was making test with a colleague on how to use it, but no changes to the hierarchy is reflected on the other machines. The closest we get was trying saving scenes and loading onto hierarchy after pulling latest changes, it manage to somehow work for the first time , but not with additional changes.

    • @GarnetKane
      @GarnetKane  5 месяцев назад

      Hey - unfortunately the way github/version control works is you won’t be able to work simultaneously on a branch without one end pushing it up and the other end pulling in the changes

    • @HailScreaM77
      @HailScreaM77 5 месяцев назад

      @@GarnetKane i don't think I've understand you, but of course the changes were pushed before being pulled, we know how to use git plz, we test with branches too, we will test again later

    • @HailScreaM77
      @HailScreaM77 5 месяцев назад

      it work if you activate LFS, and close unity every time you add, push and pull changes , otherwise Unity will not let git do it job.

  • @josemartins-game
    @josemartins-game Месяц назад

    Unity does not work well with Git. I keep losing references to materials or textures just by switching branches, opening and closing the project without touching anything.

  • @fizcore3806
    @fizcore3806 2 месяца назад +1

    Will this sync to my mobile GitHub app?

    • @GarnetKane
      @GarnetKane  2 месяца назад

      Hey! Should do no problems - as long as you’re using the same github account on your mobile as your desktop!

  • @noway1co
    @noway1co 19 дней назад

    why not just create the unity project inside the git folder intially?

  • @tommallama9663
    @tommallama9663 6 месяцев назад

    I was a big fan of using Github but I didn't like that if I had a conflict, my only option was to stash my changes.
    Maybe there is a solution using Gitbash or something, but the Github Client doesn't seem to have a good solution for dealing with conflicts.

  • @hhattonaom9729
    @hhattonaom9729 5 месяцев назад +1

    i don't get it.

    • @GarnetKane
      @GarnetKane  5 месяцев назад

      Ahh damn- what part of it are you having trouble with?

  • @TheGekko
    @TheGekko 2 месяца назад

    In case anyone is still following this guide... Github is case sensitive and unity refuses to work with Unity "just like that".