Git and Github
Git and Github are fundamental tools for CS, which I don't think I've fully explored. Yet, the primary usage of git and Github is still essential for my work, so here I only give you some basic introductions based on what I know and may add much more stuff in the future if I learn more about them.
Minimum things you should know are:
Github is the host I used to save and share with you the code and small data files.
it's based on git.
Use git and Github for each one of your project.
Git
From git home page:
Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Git helps you:
manage the history of ALL your files related to a certain package (usually inside a single directory, which is called a repository). It adds the "save" and "rollback" bottom to your whole directory.
Together with Github, it backups your files online in a remote repository.
It allows multiple people to collaborate together. Indeed, most packages hosted on Github has dozens or even hundreds of contributors.
Github
While git controls your local file, Github is the remote host that allows you to upload your local repository into a Github repository. It's free!
Github repo is not intended for hosting large files (> 100 MB). It's usually used for hosting code, text documentation (markdown), Jupyter notebook file, some small dataset. If you save large raw data in the same directory, you can use .gitignore
file to exclude them from backing up to Github. Use other ways (google drive, etc.) to back up large files.
Use git and Github
I do not want to explain git in detail, because there are tons of material introducing git and Github for beginners. Here are my suggestions to start:
Check your terminal, whether
git
is installed.Create a Github account. (This is mine)
Watch this 3min video from Github.
Read this neat introduction: https://rogerdudler.github.io/git-guide/
Once you understand basic git command (
git clone
,add
,commit
,push
,checkout
,merge
), you can use Github Desktop - GUI from Github for easier controlling.Clone or fork (in Github, fork means make a duplication of this repo to your Github) my Github repo for this book.
Learn a bit more about git ignore to prevent adding large file or temp file into your git repo.
My Github repo is still updating until this tip disappears. If you cloned my repo, usegit pull
to update it.
Clone Github Repository of This Book
To get all the data and jupyter notebooks for this book:
I do not recommend direct changing this repository directory, because you may encounter some git errors when you are trying the git pull
, if that happened and you can't solve it, delete this directory and rerun git clone
. But that means all your custom changes will be gone.
Last updated