Up and Running with Git Transcripts
Chapter: Introducing Git
Lecture: Git is distributed source control
0:00 In our why git section. And we said that git is distributed and that that was
0:05 an advantage. That was one of the main reasons people started using GIT.
0:09 There are other distributed source control systems probably most notably is mercurial but git is by
0:15 far the most popular one. So in this short video we're going to talk about
0:19 what does it mean to be a distributed source control system,
0:25 There's you you are developer and throughout this course you're going to be represented by this blue
0:31 woman with curly braces on her t shirt and you have a git repository.
0:37 That's what this little icon at the bottom is this bottle looking thing with a git
0:42 logo on it. This is your repository.
0:44 It holds not just your source code but every version and every change made to that
0:50 source code either by you or other people who may be working on this project.
0:55 All right. So this is your copy of the repository.
1:00 There's a definitive centralized repository as well.
1:05 You can have multiple ones but generally there's just one centralized one and this is the
1:10 one that other people might come and discover and look at this one.
1:16 That's your copy is just on your computer.
1:19 This other one. Some hosting server probably git hub.
1:23 But it could be other places.
1:24 As we've said, it could be git lab could be a server reset up.
1:28 There are many different places where you might host this but this is another server.
1:33 You've got a copy on your system.
1:34 Now, how did that copy get there?
1:36 You have to do what's called a clone.
1:39 But the way you should really think of this is copy because a copy is not
1:44 connected to or linked back to the original thing.
1:47 It's like I went over there,
1:48 I grabbed those files and I dropped them here and it took all the history and
1:53 changes that the hosted system knew about and it put it on the system,
1:58 on your computer, on your file system after that they are disconnected.
2:03 So any work that you might do,
2:04 Any updates that you might make,
2:06 you make that to your local Git repository
2:09 Not the shared one. Just your file system.
2:12 That local file system version knows how things used to be and how it is.
2:17 But anything a team member might do or someone else might do is completely unrelated to
2:23 this. The hosting server could change.
2:27 It's not going to affect you.
2:28 Right. If you want those changes from the server either to take what updates you've
2:34 done and move them over to the server,
2:36 you have to push those changes in a conscious separate step.
2:39 You're like, I've done a bunch of work and now I'm ready to synchronize with
2:43 that hosted server that distributed server.
2:45 So I'm gonna push my changes or maybe there were changes done some other way.
2:49 But other people on that server,
2:51 I can pull those changes back and re synchronize so we can do this synchronization.
2:56 But other than that step, there's no connection between them,
2:59 You have team members. Maybe this is an open source project.
3:03 Either of other contributors, You can tell them they're on your team because they also
3:06 have the curly brace shirt, right as they work on it.
3:10 They also have copies of this,
3:11 git repository on their local computers,
3:14 their laptops, desktops or whatever.
3:16 When they make changes, they're just changing their local version as well.
3:20 And so it's not until they decide to synchronize with a push pull that maybe they're
3:26 going to see the changes that you've created or that one of the other person made
3:30 and then they got those changes.
3:32 Alright, so everybody, your team members or open source contributors as well as you
3:37 have this own copy they got through this concept of cloning and in order to synchronize
3:44 those changes, there's a second step not just save it to the repository,
3:48 save it to source code that's committing,
3:51 but you have to synchronize it traditionally the way this has worked,
3:54 there's one and only one place that everybody committed to that's the centralized source control.
4:00 That means you have to have write access to it and you're making permanent changes for
4:03 everyone. So you can see there's way more flexibility in the system at the cost
4:08 of a tiny bit of complexity but you'll get used to it right away,
4:12 I'm sure. So git is distributed when they say it's distributed source control this is what they mean.