Hi! This A Minute of Overpass. My name is Eric and I make apps. Now, this week I wanna
talk about Source Code Control....(snoring) Okay! So this week I wanna talk a little bit
about Source Code Control, which admittedly is kind of a boring topic, right? It's something
that ...that if you're a software developer, if you're like a professional software developer
and you've been doing it for a long time, you most likely used Source Code Control in
the past, I've been using it for years, and by Source Code Control I mean GIT, Subversion,
SourceSafe, Team Foundation Server, these are all these in the past and lots of other
different variations, but they all pretty much work the same. They give you the same
benefits, and it's something that's so important to do when you're developing an app or any
kind of software, but it's very easy not to do is to have a good plan of Source Code Control.
So what I want to do now is show you kinda what we do and how we do it with our projects.
Right? The reason why I'm bringing this up is I have been hearing from a lot of people
lately, who have hired other developers and, you know, either individuals or companies,
and when it comes to Source Code Control, they don't have access to the code, or they're
sending files back and forth to each other and things like that. And really there is...software
has been around for so long that there's ways of doing working in a team environment that
are much easier, and if you're hiring developers you really should have something where you
can check on progress on a regular basis rather than waiting until the end of the project
and doing like a front end check, so even if you're not a developer this is also something
that's very important. Now, Source Code Control is a...we've been using..for Overpass we've
been using Subversion for many years. So everything that we've been doing has been with Subversion
up to about until a year ago we finally took and move everything over to GIT. And GIT is
the source of the current, like the popular one at the moment. Now, I know there's a lot
of discussions out there, like I said I'm not gonna go into details of what's different
between all of them, but I will go through how we use GIT and just how easy it is. Now,
the reason...again I was talking to a client and he didn't quite understand what I was
talking about so once I demonstrated it to him, he said "Oh! I get what you mean." So
what Source Code Control does is that every time you make a change or a series of changes,
or maybe once every few days you can just check in your code into the Source Code Depository
and then other developers can get access to it, or even if they don't, you would be able
to have like a pin in your code so if I'm gonna do something dangerous in the code or
not even dangerous, I'm just going to make a small change, what I'll do is I'll say,
I'll check in my codes saying "this is where the codes is at version 1.1 " and then I'll
make some changes, and in that way, if the changes are successful I may check in again
as version 1.2 , or you know, if I release it I'll save the currently released version
or I may say testing this version, and then in that way if I completely mess it up, you
know, you might be changing code all over the place, if I completely mess it up I can
roll back to the previous version, or if I release a new version and there's like a bug
and we're sure that it's working in the last version we can still go through and pull down
the codes from that previous version, compile it and compile the new one and find out if
there is a discrepancy between the two, and why it was working before and not working
now and what has changed and everything like that. So, what we were using before...we used
so many different Source Code control Host. We used to do it ourselves, I did have my
own Subversion server, however it's so cheap to..I mean you can do it for free with other
companies , you know, privately hosted source code control. The last one we were using was
CloudForge, and they were pretty good but it was like, you know 10-20 dollars a month,
and we recently moved everything over to Bitbucket and Bitbucket is really good with... like
the free program so you can setup lots of different projects and I think up to 5 developers,
you know, it's still free. Let me give you ah..let me show you my screen here so you
can see what I mean by Bitbucket. So here's some of our recent projects from my Bitbucket
dashboard. So you can see I'm gonna grey out some of these because its clients' projects,
however you can see here..some of the code here like the Spy framework. The last time
it was updated..the some other thing.. most of them are clients projects so I'm just gonna
grab most of it here. So let me go in this Spy framework in here, right? So here's one
that our developers are working on...so I was not working on this project, but somebody
that was working for me was, so what he was doing is that every few days he would check
in a new version of the code. So he would work for a few days and he would make a commit.
So if I go into the dashboard here I can see that Joey last committed to build for the
Spy Framework which is Chinese Spy on the 22nd of December, just put a little comment
there, I can see if I can go into this I can see what actually changed in that build, so
I can see the files that are actually update. If I go into that file I can see what's changed
from the previous version to this version. So it gives you a lot of control, but also
I can go into the source here and just look at all the source code control, and more importantly
I just can go through and download all the codes using the GIT commands and run it locally,
so and I can make a change and I can push those changes. So let me go through the whole
process here so you'll see what I mean, and again if you're an experienced software developer
you've done all this before. I'm not gonna go into anything that's too specific because
a lot of this stuff is made overly complicated. I think just by using what I'm gonna show
you now you are so much better off than if you don't use anything at all. right? so we
can get into branching and merging and all that kind of stuff, which is more advanced,
but even if you are just to commit and push changes you'll be better off. So let me go
into the code over here. Here is the code for the Spy framework, so this is Joey's last
version here, and let's say I'll go through and I make a change, so this is just a...I'm
gonna put a comment in here , so ..comment made by Eric. This is Luah using Corona SDK
actually if you're wondering. So comment made by Eric, so I can go through here and I can
say print. Comment..so this one actually change the code and I go through and I save it. So
that made a change. Now this is fine. If I just go through it and changing all the code,
everything will be fine. you know, I'm backing it up with time machine anyway, so I would
have a local copy, however if my hard drive crashed or my time machine crashed or my house
burned down..all of that code will be lost. however, so what I do is every so often I'll
go through and go into a command line here, which is under that folder and you initialize
a GIT depository and GIT stands for...I don't know what GIT stands for. you can look it
up or put it in the comments. But you can just go through here and say "git add" so
add anything that has been missing from here, so that's the first command I use on a regular
basis, then I go "git commit" dash M, and don't let the command line put you off, it's
like I said it's 4 commands.. it's all you really need. "git commit -m" and I'll put
"Eric changes for 11 Jan" or whatever, if you have people working for you, like I said
I like to have commits frequently. I don't wanna go too long without it. I'm so.. we
had so many hard drive crashes here and there, or things being lost or things being messed
up that you wanna check it as often as you can. So then I go commit and basically goes
through in it, and it checks in all the codes there that.. that's new. So anything that
has been changed recently, it gets put in, in there. Now, with GIT, it's different than
other source code control because this just did a...it checked it in locally so if my
hard drive crashes I still lose this, so I what I need to do is push it to the server
which is Bitbucket. So the next command I do..the third command I just do "git push",
and sometimes you can put the origin..origin. or the origin is where it goes, so just get
push and basically what that does is take the code and push it to the server. So if
I go to...back to Bitbucket and I refresh this. Actually I go into the dashboard here,
you can see here that Eric pushed the change for the 11th of January, 16 seconds ago and
if I went into that I can see that what's actually changed and everything has been checked
checked in there and you can see here it's been added my comment, so and what this means
is that if Joey's working on the code or another developer is working on the code rather than
me sending them the change like "Hey I make this change and we are trying to keep things
in sync", all he would have to do is go into GIT...into GIT under his code he just say
"git pull", so and basically what it would do is take the latest version of the code
and update his version so we could both work on the code at the same time, however like
just what you saw, he was doing most of the code but I as a project donor was able to
just check to make sure things were being done, everything well okay. And like I said
Bitbucket's the one we are using at the moment, but there's lot of other ones. So those 4
commands "git add", "git commit" to check it in locally, "git push" pushes it into the
server, if my hard drive crashes and the building burns down, it doesn't matter, you know, I
can still get a new laptop and pull down that code, and everything's done and the other
developers can get through and say "git pull". The other things I can do is go through into
Bitbucket and add and remove permissions based on that code, so rather than send the code
off and everything's all over the place then depended on someone else's machine I have
access to the codes at all times. Now, doing this with code is very easy, you could also
do other things like documentation, you can setup a folder for your keystore if you're
doing an Android app, you definitely want to put your keystore some place safe. You
can say Dropbox or an external hard drive. But if you put it into a source code depository
then it's very safe. And you saw how quick that was, it's not a long process, it's like
every few days they can "Oh I better check this in", you know, "git add", "git commit",
"git push" I don't have to worry about it anymore. And the good thing about this is
if I go through and I make loads of changes locally and nothing works again and I just
wish I never touch it in the first place, it was a stupid idea to begin with to make
a change to the code and I completely mess everything up, I could just revert, I can
do git..I think it's "git revert" and just roll back the changes, or I can just go look
and see what's actually been changed and I can go to the Bitbucket front end, I could
do "git diff" and there's a lot of other commands to roll back to the changes the way you had.
So what you should be doing if you're done already is every time you release an app to
the app store is at least have it pinned so you that you could see if you have go back
and look at what was on that version versus what's the current changes you can do. Like
I said you should also be checking on things like the "psd" files for Photoshop, any other
information you need, if you're using a database, the database schema in case, let's say your
server goes down and you need to rebuild it, everything's done. and this is what professional
developers do....You must have some sort of source code depository and, but it's so easy
not to do. It's so easy to ignore it and as boring at it is I want to go through this
this week and just say if you're not using source code control..you really should. So
that's it for this week! I hope you enjoyed it. I'll talk to you next week. Goodbye! Hey!
I really hope you liked that video. Now, I do this once a week so if you wanna hear more
or you wanna hear more about our experiences with the app store either Google Play or iTunes,
please go ahead and subscribe to the channel, and please like this video and leave a comment.
I love reading the comments. I love hearing what you have to say, even if it's just hello
or whatever and like I say before, if you're not sure what to say in a comment, like I
never know what to say in a comment...I'll make it easier for you. If you like it, just
go ahead and say "Gnarley" which is an 80's term, or if you didn't like it...just say
"Bogus", and if you didn't think anything of it, just say
"Eh". So that will be a big, big, big help. And another thing you could do which I'd really
appreciate it...if you are on the app store and you wanna try one of our apps, look up
some of the Overpass apps applications either on iTunes or Google Play, and leave a review,
and let us know what you think about it, either good or bad, but, you know, it's a ...we
are all trying to build up in the market so... so that will be a big help. So that's
it. I'll talk to you next week!