To fork a repo, create a branch and make a pull request


  • A GitHub account
    • This exercise can actually be completed entirely via the GitHub.com web interface (UI), but we recommend using a command-line git client if you’re interested in doing later exercises that can’t be completed through the web UI.


Note: The screen shots and instructions below refer to the generic hello-numerical-world repository. For this event, you will use bssw-tutorial/hello-numerical-world-2021-06-isc instead.

Step 1. Fork the tutorial repository: (fork example)

The fork you have created lives in your personal area in GitHub, but has the same base name (and the same contents) as the original repository, e.g., /hello-numerical-world-2021-06-isc .

Step 2. Clone the fork (on command line)

  • Click on arrow next to code for path to clone. see (clone example)
  • Copy path to clipboard (use path in command below).
   $git clone https://github.com/<your username>/hello-numerical-world-2021-06-isc.git
Cloning into 'hello-numerical-world-2021-06-isc' ...

Step 3. Create branch

   $cd hello-numerical-world-2021-06-isc
   $git checkout -b issue-1000
   Switched to a new branch 'issue-1000'

Step 4. Make Modification (use your favorite editor)

   $vi README.md
   $ git diff
   diff --git a/README.md b/README.md
   index 3cd1a3c..b44c57e 100644
   --- a/README.md
   +++ b/README.md
   @@ -22,7 +22,7 @@ is known as the _Diffusion Equation_ and also the [_Heat Equation_](
    ### Simplifying Assumptions
   -To make the problem tractable for this lesson, we make some simplifying assumptions...
   +To make the problem tractable for this lesson, we make some simplifying assumptions:
   $ git add README.md 
   $ git commit -m "Replace ... with :"
   [issue-1000 2271b74] Replace ... with :
    1 file changed, 1 insertion(+), 1 deletion(-)

Step 5. Useful git commands to check repo

   $git remote -vv
   origin	https://github.com/<your username>/hello-numerical-world-2021-06-isc.git (fetch)
   origin	https://github.com/<your username>/hello-numerical-world-2021-06-isc.git (push)

   $git branch
   * issue-1000

Step 6. Push change to fork

   $ git push origin issue-1000
   Enumerating objects: 5, done.
   Counting objects: 100% (5/5), done.
   Delta compression using up to 8 threads
   Compressing objects: 100% (3/3), done.
   Writing objects: 100% (3/3), 300 bytes | 300.00 KiB/s, done.
   Total 3 (delta 2), reused 0 (delta 0)
   remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
   remote: Create a pull request for 'issue-1000' on GitHub by visiting:
   remote:      https://github.com/<your username>/hello-numerical-world-2021-06-isc/pull/new/issue-1000
   To github.com:<your username>/hello-numerical-world-2021-06-isc.git
    * [new branch]      issue-1000 -> issue-1000

Step 7. Issue pull request to upstream repository