Up and Running with Git Transcripts
Chapter: Our first git repository
Lecture: Excluding files

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Let's jump back over here to PyCharm and notice we have our two files that
0:07 have some pending changes that we want to work with.
0:10 We probably want to save them.
0:11 We want to save our requirements.txt and we want to save our app.py
0:15 that is part of the software.
0:18 But if we take a different perspective over here,
0:21 notice that source tree says there's actually nine files that could be committed.
0:27 Well that's weird. What's going on?
0:28 Let's open this real quick and you can go to its commit section and there's a
0:33 bunch of these .idea files.
0:36 These are what PyCharm, not Python but PyCharm the editor uses to manage
0:42 its projects. Some of them should be committed,
0:44 maybe some of them not. You can decide we're going to deal with that later
0:49 but let's go through different stages of adding some of these files and committing them to
0:54 source control. Remember not synchronizing on Git hub,
0:57 there's still nothing there just locally.
1:00 So we want to add some files here.
1:02 This one is already pending because it's green.
1:04 The red one is untracked. How do we do that?
1:07 There are many, many ways so we can come over here and we could say
1:12 we want to commit. So we could click on that or we could click over
1:16 here on this section and notice there unversion files even PyCharm will eventually show that it
1:21 has those files there and this one.
1:24 So let's just do a commit here.
1:26 So this is going to be the equivalent of a git commit with a message and
1:31 the message will be add flask as a requirement.
1:36 And notice PyCharm is saying if you want to refer to this file that seems
1:40 to have that name you can I'm not going to but but we could if we
1:45 want right, so we can just hit commit or there's actually a button that will
1:50 do both commit and synchronize. We'll just say commit for now and go back now
1:55 Our requirements has just gone back to normal color.
1:58 We have this one over here still to work with in a real world situation.
2:03 What I would do is just work in one editor,
2:05 I would just work in PyCharm or I would work in
2:08 VS code but I want you to see how it looks depending on which editor you
2:12 use and what style you want to work with.
2:15 Let's go over to visual studio here.
2:18 Remember we've committed requirements.txt so it's it's gone back to its normal color but
2:24 let's work with app.py and the idea of stuff we're not going to mess
2:28 with that yet, but we want to add our flask code here of course.
2:32 So let's go over to the source control section there and visual studio code embraces.
2:40 Git a little bit more into breaking all of the pieces apart a little bit closer
2:46 to the command line. So here if I want to make some changes,
2:50 what I need to do is first do we get add and then they get commit
2:54 So I wanted to stage the change here,
2:56 so I hit the plus for that.
2:58 There's a stage change and we don't really have any others.
3:02 We don't want to work with those for now.
3:04 I guess we could add that one but I won't.
3:06 So this will just be our basic flask app,
3:12 we hit commit. Now that's committed,
3:14 we go back to looking at how things look in the project and again,
3:20 although I went back to normal,
3:22 we should see that over in PyCharm as well.
3:24 These things synchronize pretty well. It takes just a moment for it to realize and
3:28 then app goes away as well.
3:30 Also back over here in source tree that has realized again that both those changes were
3:37 committed. Now notice we have a two little up arrows,
3:42 there's two commits. If we look at the history,
3:44 here's where it is on github but we added a flask as a requirement.
3:50 That means we did a plus on the requirements.txt and here's how it changed
3:53 And we also did a our basic flask app which added this file with that
3:59 content. Okay, so that's how we take the content that we're working with and we add it to the repository and commit it locally.