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


Talk Python's Mastodon Michael Kennedy's Mastodon