This is video #5 in the Data School series, "Introduction to Git and GitHub." Relevant links and the full transcript are below. Playlist: http://www.youtube.com/playlist?list=PL5-da3qGB5IBLMp7LtN8Nc3Efd4hJq0kD
== LET'S CONNECT! ==
Blog: http://www.dataschool.io
Newsletter: http://www.dataschool.io/subscribe/
Twitter: https://twitter.com/justmarkham
GitHub: https://github.com/justmarkham
== LINKS RELATED TO THIS VIDEO ==
Open Source Data Science Masters: https://github.com/datasciencemasters/go
Forking a Repo: https://help.github.com/articles/fork-a-repo
Deleting a Repo: https://help.github.com/articles/deleting-a-repository
== TRANSCRIPT ==
In this video, we're going to discuss how and why to fork a repository, and also how to delete a fork.
Forking is one of the simplest GitHub operations. In this case, we're going to fork the repo for the "Open Source Data Science Masters", which is basically just a Markdown document linking to good resources for learning data science topics.
To fork this repo, you just need to be logged into your GitHub account, and then you click "Fork". Wait a few seconds, and it will be done.
So, what actually happened here? You've simply made a copy of the repo in your own account. That copy includes all of the repository files, and even the commit history is preserved. There's also a link to the original repo that you forked, which is often called the "upstream repo".
So, why did we fork this repo? Usually, you fork a repo either because you just want a copy of the files, or because you intend to contribute to that repo. We'll talk more about collaboration in a future video, but basically, here's how it works:
Step 1 is that you fork the repo, which we've already done. Step 2 is that you make a modification to your fork of the repo, perhaps by adding a new link. And step 3 is that you send a "pull request" to the repo owner, asking them to pull your changes into their repo.
So to be clear, once you've forked a repo, your fork does not automatically stay in sync with the original upstream repo. I'll show you in a future video how to sync your fork with the upstream.
Also, you might have noticed that we did all of the forking in GitHub, not in Git. That's because forking is a GitHub concept. Nothing happened to your local machine just by virtue of forking a repo.
Finally, let's say you want to delete a fork. Simply click on "Settings", scroll to the bottom, and click "Delete".