Data Analytics Bootcamp
  • Syllabus
  • Statistical Thinking
  • SQL
  • Python
  • Tableau
  • Lab
  • Capstone
  1. Git and GitHub
  • Syllabus
  • Statistical Thinking
    • Statistics
      • Statistics Session 01: Data Layers and Bias in Data
      • Statistics Session 02: Data Types
      • Statistics Session 03: Probabilistic Distributions
      • Statistics Session 04: Probabilistic Distributions
      • Statistics Session 05: Sampling
      • Statistics Session 06: Inferential Statistics
      • Slides
        • Course Intro
        • Descriptive Stats
        • Data Types
        • Continuous Distributions
        • Discrete Distributions
        • Sampling
        • Hypothesis Testing
  • SQL
    • SQL
      • Session 01: Intro to Relational Databases
      • Session 02: Intro to PostgreSQL
      • Session 03: DA with SQL | Data Types & Constraints
      • Session 04: DA with SQL | Filtering
      • Session 05: DA with SQL | Numeric Functions
      • Session 06: DA with SQL | String Functions
      • Session 07: DA with SQL | Date Functions
      • Session 08: DA with SQL | JOINs
      • Session 09: DA with SQL | Advanced SQL
      • Session 10: DA with SQL | Advanced SQL Functions
      • Session 11: DA with SQL | UDFs, Stored Procedures
      • Session 12: DA with SQL | Advanced Aggregations
      • Session 13: DA with SQL | Final Project
      • Slides
        • Intro to Relational Databases
        • Intro to PostgreSQL
        • Basic Queries: DDL DLM
        • Filtering
        • Numeric Functions
        • String Functions
        • Date Functions
        • Normalization and JOINs
        • Temporary Tables
        • Advanced SQL Functions
        • Reporting and Analysis with SQL
        • Advanced Aggregations
  • Python
    • Python
      • Session 01: Programming for Data Analysts
      • Session 02: Python basic Syntax, Data Structures
      • Session 03: Introduction to Pandas
      • Session 04: Advanced Pandas
      • Session 05: Intro to Data Visualization
      • Session 06: Data Visualization
      • Session 07: Working with Dates
      • Session 08: Data Visualization | Plotly
      • Session 09: Customer Segmentation | RFM
      • Slides
        • Data Analyst
  • Tableau
    • Tableau
      • Tableau Session 01: Introduction to Tableau
      • Tableau Session 02: Intermediate Visual Analytics
      • Tableau Session 03: Advanced Analytics
      • Tableau Session 04: Dashboard Design & Performance
      • Slides
        • Data Analyst
        • Data Analyst
        • Data Analyst
        • Data Analyst

On this page

  • Installation and Configuration
    • Installation
  • Sign Up for GitHub
  • Git Configuration
    • Check Current Git Config
    • Set Username
    • Set Email
    • Verify Updated Config
  • Generate Personal Access Token (PAT)
    • Steps
  • Generate SSH Key (Optional but Recommended)
    • Steps
    • Copy SSH Key
    • Add SSH Key to GitHub
    • Create a Remote Repository on GitHub
  • Adding a Dummy File
  • Pushing to GitHub
  • Pulling Changes from GitHub
  • Cloning a Repository (Alternative Workflow)
  • Summary Workflow
  • Homework
    • Create a Remote Repository on GitHub
    • Clone the Repository to Your Computer
    • Create a Dummy File Locally
    • Add a New File on GitHub (Remote)
    • Pull the New File to Your Computer
    • Submission

Git and GitHub

Lab Sessions

Git
GitHub

Installation and Configuration

Installation

  • macOS: Install Xcode Command Line Tools. Open Terminal and run:
xcode-select --install
  • Linux: Git may already be installed. If not, install it using:
sudo apt install git
  • Windows: Download Git for Windows from
    https://git-scm.com/download/win and install it with default settings.

To verify that Git is installed, run:

git --version

Sign Up for GitHub

Follow these steps to create a GitHub account:

  1. Open the GitHub website:
    https://github.com/
  1. Click Sign up in the top-right corner.

  2. Enter your:

    • Email address
    • Password
    • Username
  1. Choose your email verification preferences.

  2. Complete the verification challenge.

  3. Click Create account.

  4. GitHub will send a verification code to your email. Enter the code to activate your account.

  5. Choose the Free plan (sufficient for this course).

After this, your GitHub account is fully ready.


Git Configuration

Check Current Git Config

Run the following command to see your current configuration (should be mostly empty on new installations):

git config --global --list

Set Username

git config --global user.name "your_name"

Set Email

git config --global user.email "your_email"

Verify Updated Config

Check again:

git config --global --list

Generate Personal Access Token (PAT)

GitHub no longer accepts passwords for Git operations.
You must generate a Personal Access Token (PAT).

Steps

  1. Sign in to your GitHub account.

  2. Navigate to:
    Profile → Settings → Developer settings → Personal access tokens → Tokens (classic)

  1. Click Generate new token.

  2. Select scopes (minimum recommended):

    • repo
    • read:org
    • workflow
    • or simply select all
  1. Set No expiration.
  1. Click Generate token.

  2. Copy the token and store it securely.

You will paste this token when executing:

git push

Generate SSH Key (Optional but Recommended)

SSH keys allow secure password-less authentication with GitHub.

Steps

  1. Open Terminal or PowerShell.

  2. Generate a new SSH key:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  1. When prompted for a location, press ENTER to use the default:
~/.ssh/id_rsa
  1. When asked for a passphrase:
    • leave empty for no passphrase
    • or enter a secure passphrase
  2. Display your public key:
cat ~/.ssh/id_rsa.pub

Copy SSH Key

macOS:

pbcopy < ~/.ssh/id_rsa.pub

Windows PowerShell:

Get-Content ~/.ssh/id_rsa.pub | Set-Clipboard

Add SSH Key to GitHub

  1. Go to GitHub → Settings → SSH and GPG keys
  2. Click New SSH key
  3. Paste your key
  4. Save

Create a Remote Repository on GitHub

  1. Log in to your GitHub account.
  2. Click the New repository button.
  3. Fill in:
    • Repository name
    • Description (optional)
    • Set it to Public
  4. Do NOT initialize with README (we will create files locally).
  5. Click Create repository.

GitHub will show you the remote URL, e.g.:

https://github.com/username/myrepo.git
  1. Choose a folder on your computer.
  2. Initialize Git in that folder:
git init
  1. Connect your local repo to the remote repo:
git remote add origin https://github.com/username/myrepo.git
  1. Verify remote:
git remote -v

Adding a Dummy File

Inside your local project folder, create a simple file:

echo "This is a test file" > test.txt

Then stage it:

git add test.txt

Commit it:

git commit -m "Add test file"

Pushing to GitHub

Push your commit to GitHub:

git push -u origin main

If your default branch is master, use:

git push -u origin master

You will be asked for:

  • username
  • Personal Access Token (instead of password)

After authentication, your file will appear on GitHub.


Pulling Changes from GitHub

If changes have been made remotely, you can update your local repo:

git pull origin main

or:

git pull

Use pull whenever you want your local files to match GitHub.


Cloning a Repository (Alternative Workflow)

Instead of creating a folder manually, you can clone an existing remote repo:

git clone https://github.com/username/myrepo.git

This will:

  • Create the folder
  • Download all existing files
  • Set the remote origin automatically

Summary Workflow

  1. Create repo on GitHub (empty, no README)
  2. git init locally
  3. Create files
  4. git add
  5. git commit
  6. git remote add origin <url>
  7. git push

or use:

  • git clone → edit → git add → git commit → git push

Homework

This task ensures that you can create repositories, work locally, work remotely, and synchronize changes between GitHub and your machine.

Follow the steps below exactly in order.


Create a Remote Repository on GitHub

  1. Log in to your GitHub account.
  2. Click New Repository.
  3. Set:
    • Repository name: `choose any name
    • Visibility: Public
  4. Do NOT initialize with README.
  5. Click Create Repository.

Copy your remote URL, e.g.:

https://github.com/yourusername/myrepo.git

Clone the Repository to Your Computer

In a folder of your choice, open Terminal or PowerShell and run:

git clone https://github.com/yourusername/myrepo.git

This will create a new local folder with the repository inside.


Create a Dummy File Locally

Navigate into the cloned folder:

cd myrepo

Create a simple text file:

echo "This is my first Git test file." > test.txt

Stage and commit the file:

git add test.txt
git commit -m "Add test file"

Push it to GitHub:

git push

Check GitHub — you should now see test.txt in the repository.


Add a New File on GitHub (Remote)

  1. Open your repo on GitHub.
  2. Click Add file → Create new file.
  3. Name it: remote_file.txt
  4. Add any text inside it.
  5. Commit the new file.

Pull the New File to Your Computer

Return to your local repo folder and run:

git pull

You should now see remote_file.txt in your local directory.

This confirms that your local and remote repositories are synchronized.


Submission

Submit your GitHub repository and GitHub profile links here.

Example format:

https://github.com/yourusername/myrepo