Up and Running with Git Transcripts
Chapter: Introducing Git
Lecture: Git is distributed source control

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


Talk Python's Mastodon Michael Kennedy's Mastodon