Skip to main content

Git & GitHub

If it isn't saved, it didn't happen. If it isn't versioned, it's dangerous.

Data analysis is iterative. You will make mistakes. You will break code that used to work perfectly yesterday. Git allows you to save "checkpoints" of your work and collaborate with other analysts without overwriting their code.

Concept

Git is like the Time Machine.

Think of Git as a save point in a video game. Before you fight a boss (run a complex migration or refactor a query), you save your game. If you die, you reload.

Setup

  1. Install Git
  2. Have a GitHub account
  3. Configure Git credentials under local machine
  4. Clone repositories

Basic commands

To download commits:

git pull --rebase

To upload commits:

git add .
git commit -m "your message"
git push

Refer to https://ubunchuu.com/docs/15DFWT/basic-git