Up and Running with Git Transcripts
Chapter: The '6' core git operations
Lecture: Commit and add
0:00 The next two commands to think about our add and commit. Now here's a big picture of our computer that let's just talk about the work flow
0:10 a little bit the different stages that files can go through in git remember at the
0:15 beginning I said this distributed version control gives us lots of power with the added complexity of just a little bit of complexity.
0:22 Well, it's a little bit here. So our files can go through these different stages or states.
0:29 They start out as untracked. That means git doesn't care about them. They might be in the folder but it's not going to commit them or do anything
0:36 to them. Then we have staged, which is, here's a new file that we told git in the next commit. We want to be committed but is not yet committed.
0:45 It's basically tracked. And then there's stuff that is saved into source control. As far as we're concerned, it's committed.
0:54 We also have this other status of not yet staged but tracked. That's like added but not yet pushed in. Okay, now we can go from untracked,
1:05 we add a new item and now it's staged or we can have some changes that
1:10 were a previous file that getting new about that we opened and made some changes to And we also have to actively add those changes in to git we have to
1:21 say I edited that file and when I do a commit, I do want that, those parts that I changed over there also included.
1:28 So there's this sort of not staged but edited and then staged for being committed.
1:34 And then finally, when you've done a bunch of work and you sort of coordinated everything that all of this work, this is all ready to go in.
1:40 As one change to the software, it gets added through a commit to get saved to a commit.
1:47 It's really important to realize all of this is happening on your computer add and commit have nothing to do with some hosting server.
1:55 It's completely unaware of the fact that these changes are happening. Other people working on their copy,
2:02 their clone of the repository, they won't see this, they won't know about it. There's not a way to like lock a file while
2:08 you're working on it. This is entirely add and, commit a local thing that happens on your clone. So when you commit it, it just commits back here.
2:16 It doesn't do anything to coordinate with the other users of this repository.