Skip to content

PovertyAction/git-learning-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Learning Lab

Welcome to IPA`s Git Learning Lab! 😄

Here is the agenda that we are following for the Learning Lab:

Learning Objective: to become familiar with the value of git and GitHub for version control and peer review

Motivation: at IPA we are increasingly using Git for version control for research and data science projects, software development (e.g. Stata programs), and knowledge sharing (e.g. the Research and Data Science Knowledge Hub). We want to make sure that a wide set of colleagues are able to collaborate on these resources and know how to utilize Git and GitHub for version control and peer review.

Preamble

  • Git is a valuable tool for managing version control of source code (e.g. Stata, Python, R)
  • GitHub is an online resource for managing source code (and in some cases deploying code to websites, databases, and other online/cloud infrastructure)
  • The goal is for YOU to learn git, you don't need to become an expert
  • Another goal is for US to be more collaborative in learning and sharing
  • You will likely run into challenges. git is very valuable, but can be hard
    • Go through the materials, practice, practice, practice
  • You are not alone
    • Be proactive in sharing what you learn
    • Ask questions
    • Help others answer their questions
    • Use Huddles, Google Meet, or Zoom to interact with colleagues. Or pair with a colleague in person...but remember to share out if you pair in person.

Agenda

Day 1

Focus: get set up with GitHub, git, and (optionally) VS Code

Setup

winget install Git.Git GitHub.GitHubDesktop Microsoft.VisualStudioCode

Read

  • Getting Started
    • Getting Ready for Class
    • Getting Started
    • GitHub Flow
    • Optional: Getting Started with GitHub Desktop
  • Read: About Git
  • Watch:

https://youtu.be/r8jQ9hVA2qs?si=PRA_v74lv0hGv5qr

Activities

  • GitHub for Developers Project 1: Caption This
    • Branching with Git
    • Local Git Configs
    • Working Locally
    • Collaborating on Code
    • Editing on GitHub
    • Merging Pull Requests
  • Review grds-python-template repository
  • GitHub for Developers Project 2: Merge Conflicts
    • Defining a merge conflict
    • Resolving merge conflicts

Applied Exercises

  • GitHub Learning - Introduction to GitHub (Complete the tasks described in the repository)
  • Optional
    • Communicate using Markdown

Additional References

Day 2

Focus - become familiar and comfortable with peer reviews (pull requests on GitHub) as well as how to resolve merge conflicts

Read

  • Consider using GitHub Desktop or VS Code
    • GitHub Desktop
      • Getting Started with GitHub Desktop
      • Using Github Desktop video
    • Git with VS Code
      • Using Git source control in VS Code
      • Introduction to Git in VS Code
      • Working with GitHub in VS Code
  • Read: Creating a pull request
  • Watch:

https://youtu.be/nCKdihvneS0?si=yFM30q-_xO6vvTme

Activities

  • GitHub for Developers Project 3: GitHub Games
    • Workflow Review
    • Protected branches & code owners
    • Reverting commits
    • Helpful Git Commands
  • GitHub for Developers Project 4: Local Repository
    • Create a Local Repo
    • Fixing commit mistakes
    • Forgot to branch
    • Rewriting history with Git reset
    • Cherry picking
    • Merge strategies

Applied Exercises

  • GitHub Learning - Review Pull Requests (Follow steps outlined in the repository)

  • Optional:

    • GitHub Learning - Resolve a Merge Conflict
  • Bonus (if you have time):

      * Create at least one pull request to an IPA repository
      * Complete at least one review of a team member's pull request
      * Some ideas for repositories to contribute to:
          * https://github.com/PovertyAction/grds-python-template
          * https://github.com/PovertyAction/ipa-research-data-science-hub
          * https://github.com/PovertyAction/Python-Resources
          * https://github.com/PovertyAction/ipahelper
    

Additional References

  • Getting out of trouble, by Miles McBain
  • Git best practices, by Seth Robertson
  • Good practice for pull requests and peer reviews
    • How to write the perfect pull request, by GitHub
    • Written unwritten guide to pull requests, by Atlassian

About

IPA Git Learning Lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published