These resources are a collection of my work, followed by a bunch of resources I found online, which can be used to learn Git and GitHub.
- Git: The Command Line -- getting used to the command line, if that's new to you.
- Git: Working with Commits -- Here, we learn about the "commit" the fundamental unit of Git.
- Git: Oh no, it's Vim! -- Deals with a common situation where you accidentally open Vim, an in-terminal text editor. Vim is super useful! But, it's a bit overwhelming for new folks.
- Exercise -- Now that you've seen the basics of the command line and git, I want you to make a repository that has exactly 4 commits in it.
- Git: Branches, Merges, and Checking Out -- Starts to show some of the power of Git.
- Optional: Learn Git in 15 minutes -- this video is the best online source I've found to back up my videos above. Mine are a bit heavier on theory, which I think is helpful for something like Git because it doesn't have much visually that it shows you in the process.
- Exercise -- Now, I'd like for you to make a particular git tree. (Meaning: make a git repository, and create commits such that the commit tree looks like as below.)
How can you prove that this correct? (Hint: it requires multiple uses of
git log
.) - At this point, I recommend reading The Git Parable (TW: alcoholism)
- Git: Merge Conflicts! -- Here, I intentionally create (and then resolve) a merge conflict, so y'all can see how.
- Git: Time Travel -- At this point, if you haven't already, I hope that you're starting to see how empowering Git is.
- Exercise -- First, I'd like you to create a simple repository that has this git tree:
Then, I'd like you to turn that respository into the following one, via time travel: - Git: Remotes -- This video begins to use remote repositories to allow you to leverage Git as a tool to build code as part of an organization
- Git: Pushing Happens on Branches, Not Trees -- Clearing up a small misconceptions.
- Exercise -- I want you now to practice a bunch with remotes:
init
versusclone
: You should make a git repository on your computer, create a remote for it (after having made it on your computer), and push code up to it. You should also make a repository on GitHub, clone it down, and figure out the difference. When would one method make more sense than another?- pushing: Make some changes to your code, and push up new changes. Verify that your remote repository is up to date with the local one afterward (and wasn't before!)
- pulling: In order to practice pulling, we need to be a little bit clever. I want you to practice having the remote and local repositories being in different states, and then fixing it. Please create two repositories: one in which the local repository is "ahead" of the remote repository, and one in which the local branch is "behind" the remote repository. Then fix each one by pushing or pulling as appropriate (and confirm that they're now in sync). In thinking about that final point, you might be confused. How could you possibly have a remote branch that's ahead of your local branch if you're the only person editing the repository? Here are two ways you could set that up:
- You can edit files directly on GitHub: what effect does that have?
- You could have a local repository which you've cloned down to a totally different, second folder on your computer, which is purposefully going to be "old", then using the main (local) repository, you push up some new code. Now, the remote is ahead of the "old" version.
- GitHub: Forks and Pull Requests -- This video covers the social aspect of GitHub, contributing to other repositories
- Git: A Full Open Source Contribution -- This video is demonstrates a full Open Source contribution. Hopefully this process should make sense now!
- Finding and Fixing a scikit-learn bug -- As a bonus, here's an amazing video where a software engineering hero of mine, Jake VanderPlas, discovers an error in Scikit-Learn, a famous open source Python library (to which he regularly contributes) at about 2 minutes into the video. He then LIVE STREAMS FIXING THE BUG (
#nerdswoon
). This video gives another example of a complete open-source software contribution. - Exercise -- OH NO! I made a typo in this git repository. Can you help me fix it? Please submit a pull request.
- Watch this decent git video (starts after install information). It's not perfect, but it will walk you through the basic commands.
- Read The Git Parable, a long blog post outlining the ideas behind
git
and why they exist. It does a good job of demystifyinggit
and convincing you that it is not something magical, that you could absolutely construct a (perhaps less optimized) version ofgit
with enough time. - Bookmark and glance through The Git Book. This is the main official-ish book on
git
. This should be your reference for any specific questions you have about the tool. - Glance through Learn Git in 30 minutes. It's going to be repetitive from the previous items, so it's on you to decide how much repetition you need. It's helpful to have this open in another window while you do the following:
- At this point, I believe that you just need to suffer through getting started with managing your own
git
repository, and learn by doing. There is plenty more to learn, but I don't think at this point you'll really feel ready to learn more until you have some experience.
All of these tools are still not bad, but I feel like they aren't necessary.
- Git from the inside out: This is my personal favorite resource for deeply learning and loving
git
. It's intense, and requires you to dive into the internals of the tool, but I promise you will come out with a much stronger understanding of howgit
works. This is not your very first introduction togit
, though; you'll need to have seen the basic commands and have a rudementary understanding of their functionality first. - Think like (a) Git: One thing I really like about this guide is the slow ramp-up pace. It takes the time to discuss how difficult it can be to learn git, and it also talks at length about graphs and why they are so important to understand first before learning git.
- git - the simple guide : Yes, the author swears in this guide. It's still a helpful resource.
- Learn Git Branching: This is an interactive tool which is awesome for understanding the manipulation of source code graphs (Often called "source trees"). However, one thing it doesn't do is show when, where, and how the actual files in the respository are being editted.
- Derek Banas video on
git
(starts after the intro, installation stuff): It's not how I would have organized the content, but it's not bad.