Up and Running with Git Transcripts
Chapter: Tips and fixing mistakes
Lecture: Tip: Sync your forks

Login or purchase this course to watch this video and the rest of the course contents.
0:00 First tip sync your forked repos we've already seen this,
0:04 but let's just dive into a little bit more detail.
0:06 Okay, we're over here in my github profile and let's go over to my
0:12 actual profile, not just my account here.
0:15 You can see all the public repositories and stuff that I have.
0:20 You can scroll down, you'll even see sort of your,
0:22 your history and where you've committed stuff.
0:24 This is generally publicly available. But let's go to the repositories.
0:27 Apparently I have 228 repositories personally and then we have a whole bunch over on the
0:31 talk python organization as well. I guess we just get up a lot.
0:36 So these are everything you can search for them.
0:38 But let's go and find the forks.
0:40 So these are all the things that I've forked that I really care about.
0:43 For example, the entire spectrum of
0:47 API's and services and web apps and all that for talk
0:52 python and talk python training are powered by Mongo DB and beanie by the way.
0:57 So these two right here, I care a lot about them.
1:00 Let's go and open them up.
1:03 Beanie, we recently synchronized with beanie.
1:06 So we have no differences there.
1:09 Mongo DB, there's always changes,
1:10 right? This is a big company.
1:12 There are tons of people working at,
1:13 there's 65,000 commits. So chances are at any given moment we are behind.
1:20 So again, if I'm going to fork Mongo,
1:23 this is not because I want to contribute to it.
1:25 You know, there many billion dollars company with tons of employees.
1:29 I'll let them can do the contributions,
1:31 but I want to have this just as a safety net.
1:34 You know, it's open source,
1:36 if something goes wrong with Mongo and they go insane Mongo DB,
1:40 it would be nice to just,
1:41 you know, have a copy of the database,
1:43 Database Server. So I cloned it but it's out of sync here,
1:47 you can see 34 commits behind.
1:49 So I'm just gonna go over here and say fetch upstream.
1:54 Now. My backup of Mongo DB,
1:56 my local copy of the source code,
1:59 it's here and again, it is in sync.
2:01 I'm not sure how long ago this was a week or two since I've last done
2:04 this, but quick and easy.
2:06 Now we're all up to date and in sync you saw this when we did the
2:09 pr but it's generally useful just if the forked repository is moving ahead and you haven't
2:15 done anything to synchronize with it.
2:17 So tip number one sync, your forked repos on github using this little fetch upstream feature that they added.