Skip to content

A Git & GitHub workshop for economists. At CEMFI (Madrid, Spain) on September 23, 2022

License

Notifications You must be signed in to change notification settings

kazuyanagimoto/github-workshop2022

Repository files navigation

CEMFI GitHub Workshop 2022

Slides

Preparation

  1. Create a GitHub Account
  2. Download the following tools
  3. Open VS Code and log in to GitHub (click the bottom-left icon of a human)

With the CEMFI email address, you can get the student developer pack.

Tools

  • VSCode (Editor and GUI tools for GitHub)
  • DVC (Version Control Tools for Data)

You might need to reboot your computer after the installation. DVC does not have a GUI application. Even if the installation succeeded, you won't see any icon in the menu.

I think most PCs have git by default. To make sure, run this in the command line

git --version

If you don't have it, downloading GitHub Desktop is one of the easiest ways to download git.

Cheet Seet

Initialize Project

  1. Create a Remote Repository
  2. Clone it to your local machine (from VS Code)
  3. Prepare the folder in Google Drive (and copy the folder code)
  4. Setup the remote of DVC
dvc init
dvc remote add --default myremote gdrive://GDRIVE_FOLDER_CODE

WorkFlow

1. Sync Local Repository (Remote to Local)

git switch main
git pull origin main
dvc pull

2. Work (Local)

  1. Checkout to dev branch
git checkout -b "dev"
  1. Write Codes

3. Commit (Local)

dvc add -R data
git add .
git commit -m "hogehoge"

4. Push and Pull Request (Local to Remote)

  1. Push to dev branch in the remote repository
git push origin dev
  1. Open GitHub remote repository
  2. Create a Pull Request (dev -> main)
  3. Confirm merge and delete dev branch

5. Sync Local Repository and Delete Developing Branch (Remote to Local)

git switch main
git pull origin main
git branch -d dev

6. Push to DVC Remote Storage

dvc push

About

A Git & GitHub workshop for economists. At CEMFI (Madrid, Spain) on September 23, 2022

Topics

Resources

License

Stars

Watchers

Forks

Languages