sciware

Sciware

Intro to GitHub

https://sciware.flatironinstitute.org/21_IntroGithub

https://github.com/flatironinstitute/learn-sciware-dev/tree/master/21_IntroGithub

Rules of Engagement

Goal:

Activities where participants all actively work to foster an environment which encourages participation across experience levels, coding language fluency, technology choices*, and scientific disciplines.

*though sometimes we try to expand your options

Rules of Engagement

(These will always be a work in progress and will be updated, clarified, or expanded as needed.)

Zoom Specific

Future Sessions

Today’s Agenda

Collaborating on GitHub

Step 0: A clean start

> mv sciware21-git-intro/ sciware21-git-intro-day1/

Collaborating with others

Forking to the Rescue

<img width=80% src=”./assets/Learn-Git-Graphics/Forking%20a%20Repo.png”>

Forking Workflow

  1. Fork and clone the project
  2. Add the code and push to your fork
  3. Merge code into the main project
  4. Keep your fork up to date

Step 1: Fork and Clone

<img width=80% src=”./assets/Learn-Git-Graphics/Clone%20the%20Fork.png”>

Step 1: Fork and Clone

First we need to fork the repo https://github.com/flatironinstitute/sciware21-git-intro
Next, we clone our fork of the repo:
        
        ➜ git clone git@github.com:your_user_name/sciware21-git-intro.git
        
    

Step 2a: Add Your Code

Step 2a: Add Your Code

For example:

    
Name,Center,Research Focus,Fun Fact
James Smith,CCQ,Quantum Chemistry,My initials are JETS
    

Step 2b: Push to Your Fork

<img width=80% src=”./assets/Learn-Git-Graphics/Push%20to%20the%20Fork.png”>

Step 2b: Push to Your Fork

For example:

    
➜ git status
...
➜ git add student_info/james_smith.csv
➜ git commit -m "Adding info for James Smith"
...
➜ git push origin main
    

Step 3: Open a Pull Request

<img width=80% src=”./assets/Learn-Git-Graphics/Open%20a%20Pull%20Request%20for%20the%20Fork.png”>

Step 3: Open a Pull Request

Step 3: Open a Pull Request

Step 3: Open a Pull Request

Step 3: Open a Pull Request

Things to think about when making pull requests (PR):

Reviewing a Pull Request

As other students make PRs, go to the pull requests tab on GitHub.

Reviewing a Pull Request

Choose another student’s PR and click on it.

Click on the commit to see the diff of their changes and hover over a line until you see the + sybmol.

PR Case Study

Here’s an example of a PR without a helpful description:

PR Case Study

Here’s an example of a PR with a helpful description:

<img height=70% width=60% src=”./assets/pr_case_study_good.png”>

Survey

http://bit.ly/sciware-github2-2022

Step 4: Pull Other’s Changes

<img width=80% src=”./assets/fetch-upstream-3.png”>

Step 4: Pull Other’s Changes

<img width=80% src=”./assets/fetch-upstream-1.png”>

    
    ➜ git pull origin main
    

Extra Resources

Check out and bookmark these tutorials for more information about git and the forking workflow:

Survey

http://bit.ly/sciware-github2-2022