Context; Learning goal is to be able to work locally, using a special patch branch, to contribute fixing of an issue to an open source project. An example of a repo with tichets is our own [https://github.com/swcarpentry/bc/issues][1] . For the concept map of the course syllabus, see [http://teaching.software-carpentry.org/2014/01/22/concept-map-github-contribute-to-an-upstream-on-a-patch-branch/][2]
- MCQ (Multiple Choice Question) to differentiate whether or not the prerequisites are met.
Q: What is usually the next step after doing a git fork in order to start working locally?
a.Git wget
b.Git clone
c.Git copy
d.Git checkout
- MCQ to ascertain the course achieved its objectives.
Q: Which command is needed once you are done with your local branch work on a ticket and want to upload it to the desired destination, eg Github?
a.Git remote push myBranch yourUrl
b.Git merge yourUrl / myBranch
c.Git clone myBranch yourUrl
d.Git push yourUrl myBranch
//EDIT 2014-02-12Wed.16:21:49,
Sorry, I forgot to add the Exercise at 2pm!
- EXERCISE SAMPLE WITH 3 STUDENT_GAPS
Working on open source projects can happen like so.
1.See an interesting ticket;
[https://github.com/swcarpentry/bc/issues/300][3]
Create template text for Etherpad for use in workshops · Issue #300 · swcarpentry/bc
2.On Github, sign in and Fork it.
3.Go to your source folder and bring it down.
$ cd src/
<ENTER How to get the code from Github?>
4.Go into the working folder and check that your remote matches your github info and that you’re on the right branch.
$ cd swcarpentrybc/
$ git remote -v
origin https://github.com/YOURUSERNAME/bc (fetch)
origin https://github.com/YOURUSERNAME/bc (push)
<ENTER How to see what branch you’re on?>
5.Make a nice new branch that references the ticket number and simultaneously check it out.
$ git checkout -b issue-300-etherpad-howto
Switched to a new branch ‘issue-300-etherpad-howto’
$ git branch —all
- issue-300-etherpad-howto
master
remotes/origin/HEAD -> origin/master
remotes/origin/gh-pages
remotes/origin/master
$ git status
# On branch issue-300-etherpad-howto
nothing to commit, working directory clean
6.Do your work, commit it locally, and check your patch with diff.
$ bbedit etherpad.txt
$ git add -A
$ git commit -m “#300 Etherpad file added.”
$ git diff HEAD HEAD~1
diff —git a/etherpad.txt b/etherpad.txt
deleted file mode 100644
index 566dc1c..0000000
— a/etherpad.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Etherpad.txt
—
-Instructions for Students.
—
-Go to the URL given by your instructor.
—
-The page displays a screen with three major parts.
—
-1.The left side holds the wiki with today’s notes written by the instructor.
-2.The top right side shows the names of users who are logged in.
-3.The bottom right is a real time chat window for asking questions of the instr
No newline at end of file
7.Now upload your work to your github repo.