Hello everybody and welcome to this lecture where we are going to talk about version control.
Now we've touched on this very early on in the course when we were talking about save versions within
blender or even just saving as when you're working on a blend file.
Now we're about to embark on a much larger project than we've had before.
So it's important to try out some version control.
Now you don't have to do this by all means but I've found it a real godsend to being able to do that.
And being able to roll back to a previous version or even decide well I want to try and experiment.
And if I do that I've got to remember that I need to back up all these other files zip them up and do
loads of other things that are just too onerous.
However if you use a version control system even something like source tree or in this case I'm going
to have a look at get cracking.
What you'll be able to do is commit a change that you've made and then continue experimenting or continue
working whether or not that's adding textures trying different things out.
Now I wish I knew about this when I first started because it's it's so powerful and it's enabled me
to jump back try things without the fear of losing or messing up any of my work.
Especially if you end up moving a file out to another folder or something along those lines.
At least with this system you can roll back to it.
So it's kind of like a real time or rather when you choose backup of the entire state of your project
if you so choose.
So we're going to have a look at gitt cracker.
That is one I favoured.
You'll see me using source tree in the course itself but since I've recorded those videos I've come
back and have realized that did happen is much more friendly especially to artists rather than coders.
So let's go ahead and have a look at it Kracken now and just show you around the rough premise of what
source control is without diving too deep because we only want to use it at the moment to back up our
work as we go and be able to fall back to a previous version if necessary.
So let's now hop on over onto our web browser in fact not blender.
First of all and go have a look out.
Em.
Okay so what I've done here is I've gone to Dubey w w doggett's Kracken dot com.
Now I must say at this point I'm not endorsing them as in go out and buy them etc..
I've just found personally that this system works for me.
There are many other version control systems out there that you can go off and do your own research.
If you find this is the sort of thing you actually find helpful.
So I'm going to download this right now it's free which is one of the reasons why I really like it.
And then it'll take a few minutes to download.
It's about 120 megs or so.
And of course they've got a tutorial there to get you a get started.
Do go ahead and watch that as well.
If you struggle at all it can be quite confusing when you first go ahead and try out source control
for the first time.
But once that's downloaded we can go ahead and install that now after you've installed it.
Launch the program for the first time and I'll see there in a second.
And then after a few moments you'll be presented with this screen with two signing options for the signing
with haab or create a gift crackin account.
I already have a tub accounts I'll be using that method to sign in.
However if you don't know what that is or this is the first time you've gone to source control just
go through creating your own get Kracken account and go through that.
Now I'm going to sign in.
We've got haab and I'll be back in a few moments.
And there we go.
For me that was nice and quick it signed it instantly because I was already signed.
So what do we do from here.
Well the first thing we need to do is create our new repository now repositories basically like a folder
where you going to store all of your project work.
Now I do recommend not storing all of your blender work in here but just the project you're working
on at the time.
So in this case I'm going to end it says here quite easy.
Set your preferences.
I'm fine with where things are at the moment but I'm going to open klown or initialise a repository.
That's the thing we're going to do here.
That's like clicking new.
So initialising a repository someone want to click on the folder here and go down to in it.
Now I've got a series of other options here which you can use if you were if you already had a repository
on your computer that you wanted to open up clone.
Well we're not going to touch that at the moment.
That is if you're using gifts online which is a type of version control system.
But we're just going to use it on the computer and that's why we're using local Only as well so we can
bat browse a repository path we can go into here.
And I'm just going to set it to my desktop for the moment and I'm going to put a folder on my desktop
and I'm going to call it repo short for repository test.
I'm going to select that folder.
Now it is important at this point that the folder is empty.
That is quite standard.
It starts off completely empty.
There are other things here called A Gift ignore and a licence were not going to do that at this point.
We've got nothing that we want to ignore.
We want to keep everything and our licence Well that's to do with how you sharing it how people can
use it etc..
So go ahead and create a repository a few seconds later.
It looks like this.
So what do we do now.
Well let's demonstrate what will happen if you go ahead and start adding things to that folder.
So let's go ahead and open up blender.
And when we open up blender let's say we've got our default cube I'm going to Blender's opened up on
another screens.
Drag it down here.
Now if we were working on let's say this default Q1 we go ahead and save as an go to our desktop into
repo test and call it repo test because that is exactly what we're doing and save now if we go straight
back in to get Kracken in this case and this would be the same most other source control programs it
has noticed a change.
And at the top here we can commit that change so I can call this starting cube and I can type in here.
I can also type it in over on the side as well.
The commit message so I could in the bottom here I can alter what it says.
So starting QB typed in here in the lower right we can type in starting QB again if we wanted to and
description this is where we start.
Now you can also keep a text document alongside what you're working on to put in more detailed notes
as you go and that's what I did personally.
I have a text document that I update explaining what I'm doing and why.
So once we've done that we have to stage our changes.
Now in this programming gig Kracken we can see at the top there unstaged files there's only one of them
and we can go ahead and stage that file and then commit the changes.
So now at any point we can roll back to that point in time and recover the information that we had.
But we need some more information on there so let's hop back into a blender and let's go in an edit
part of this queue save our file and then we see or at least get cracking we'll see there's a change
in that file.
So I could call this and I'm going to do the commit message in the lower right this time stretched corner
and one vertex moved also something along those lines.
I mean what are you putting your description is obviously up to you because it would be based upon what
you're doing.
So one vertex moved and then I'm going to do one final thing which is stage that change and we can unstaged
if we want or even if we wanted to revert to change that we made so you'd overwritten a particular texture
or something along those lines you know.
That took me ages to render out or something along those lines.
We could unstaged that for a second and we see here we've got a repo test blend I can right click on
it and discard those changes so we can just reverse one file back to a previous version if I want to.
But let's stage all changes and commit the changes.
And here we've got is started to build up a history of what we've done.
Final thing here that's hop out and add in a different mesh let's add in a Taurus and plop it over there
and finally save our file.
So we made a lot of edits to here we come in and we go this is our final word or whatever you know there's
there's lots of things you could do in there.
And I'm just going to commit that you don't always have to put a description in you would only need
to really put a description in it.
Your description your actual title of your commit your snapshot in time as it were if you wanted to
actually go ahead and use that.
So how would you go back to STARTING it.
Well if we go ahead and branch from it that is one of the safest ways to do it.
If you go ahead and branch and we're going to call it reverts or something something along those lines
for the moment as that's what we're testing we will now see over on the left hand side there's a master
and there's a revert.
Now they both look the same at the moment because this is a history if we go back and undo the reverse.
Right click on starting cube and make sure revert is selected over on the side and then we can reset
revert to this comet and hard.
Now hard will discard as it says there all changes that you've done.
And that's as if you've undone everything back to that point.
There are other options too.
But if I go hard here you can see that reverse ends up down here.
And now if I hop into a blender again and go ahead and revert as well.
Up here we can see that this has opened up that same file again if I go ahead and open in a number.
Q.
Adding another cube and save the file.
We've now got two histories which is really useful so that I can call this to keeps or whatever it needs
to be a stage my changes I commit my changes.
I now have two histories.
One was a starting cube to our final work and one was two cubes same project start different end points.
Now we wanted to continue where we were before say the two cubes experiment was a failure that's fine
we can double click on Master over on the left hand side you can see that the check out was successful.
And then if we go ahead and open up blender what you see here is the.
It's exactly the same.
And by going to file and revert it's the same as re opening that file again.
And we will see that it goes back to our previous version.
And there we go there's a very brief overview of a version control system there.
And I've used get crack and there are plenty more out there now.
It isn't essential that you go ahead and do something like this.
However from personal experience it's saved my bacon so many times when I've been working on a project.
And it's also enabled me to do things that I'd otherwise be worried about doing.
And it also means that I don't have a hard drive full of different files.
In fact if we go ahead and have a look at that that folder that we had on the desktop I'm just going
to bring it down.
What we can see is that we have the gift folder.
That's because I've got hidden files turned on you dont touch that we've got the read me and the repo
test and there's no other files in there at all.
So that means doesn't matter how many commits I make on the Repo test or if I had the blender projects
within this project say if it was a part of a building that you're about to make for instance then you
can go ahead and do that so that you fund it doesn't end up cluttered.
If we were to do this in the more traditional save as sense it would be very hard to keep track and
it's very hard for you to stay honest about what is the current usable version.
And if you've got lots of what versions in there you're going to make a mistake at some point and it's
going to be a really painful mistake.
And I can guarantee you will want to avoid that where possible.
Okay so there we go.
If you've got any questions over version control do give us a shout otherwise enjoy using it.
Embrace it because it is going to save your bacon so many times in the future and I will see you all
in the next lecture.