For this activity, you will use what you've learned about git to work collaboratively as a classroom to fill out a couple Madlibs stories.
-
Form a group with your neighbors. You should choose one person whose computer you will use.
-
Make a Github account if you haven't already got one. This should be a personal account for the person whose computer is being used. We'll be using GitHub in our homework assignments this semester. You don't have to use identifying information when you create your account.
-
Fork the starter repository on Github. Forking means to make a copy of the code but attach it to your own Github repository so that you can make changes. Technically you are "cloning" the starter repo. GitHub calls this "forking" because they add some other bells and whistles on top. You should see a grey button at the top that says "fork"---that is what you want. If you need more information, look at https://help.github.com/articles/fork-a-repo/
-
Clone the repo to your development environment: your computer or Cloud9, if the instructor set up a Cloud9 account for you. You can request one here.
-
Open the
index.htmlfile to see the app working on your computer. -
Take a look around at the files. Familiarize yourself where everything lives.
-
Create new stories, verbs, nouns, adjectives, and adverbs! The instructor will likely assign you to one of these. Checkout a new branch with a good name before you do your work. This will be a command like
git checkout -b kyle-new-verbs
Here, I named my branch "kyle-new-verbs". You should name yours something different, no spaces. E.g. your branch name might be "jane-new-stories" or "rad-verbs-for-class-by-rachel".
- Create a new file. You can also edit existing files, but that will make our merging harder! If you want to make a new file of verbs, you might make a file at
/js/verbs/kyle-new-verbs.jsand in that file, add new verbs.
You should choose a name other than "kyle-new-verbs.js".
-
Check your code works. Did you break the app? No? Great!
-
Commit your changes and share them
First, take a look at the status of your work
git statusIt should show what files are new and what files are changed. Now, you want to add the new files, try the
git addcommand. You'll need to supply a file name.Once you've added your changes to the "staging area", you want to make a commit. This is a command like
git commit -m "Added some verbs for class"Now, push your changes up to GitHub.
git push origin BRANCHNAMEwhere
BRANCHNAMEis the name of your branch. -
Go to GitHub, find your fork and the new branch, then make a pull request
Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
Click on the logo at right to get started.
.
Then, once you get to another page, click the blue link.

Finally, click the create button to checkout the commit.
If you need extra help, check this out https://help.github.com/articles/using-pull-requests/ or just come see a TA. -
The instructor will merge in everybody's work.