Push Changes in Bash

Let's add our part to the story and turn it in!

Edit Story

Bash is awesome - we can even open files with it.

Macs Type:

open collaborative-story.txt

PCs Type:

start notepad "collaborative-story.text"

It should open up the file in your computer's text editor. Add your own portion of the story after the last sentence.

add to story

When you're done, save the file. Make sure you keep it saved as a .txt file.

Push Changes

Now we'll push (aka add) our changes to our forked copy and then submit them to be added to the DIY original file.

Return to Bash and let's check what changes we've made. Type:

git status

git status

This shows you what files you've made changes to - it should say collaborative-story.txt. Let's see the difference before and after our changes with diff.

git diff

git diff

You'll see a plus and minus sign showing the before and after. Press Q to exit the diff.

Add Changes

Let's tell Git what files we want to add, what our message about our changes is, and push those changes to our fork.

git status add commit push

Start by adding your changed file:

git add collaborative-story.txt

Commit Changes

Now we'll add a message describing our changes and attach that to our addition.

git commit -m "your description of changes"

Push Changes to our Fork

Now, finally, we'll actually push the file and message to our fork on GitHub.com. Remember our fork's name is origin (it's our original file) and the branch is master.

git push origin master    

To complete the challenge, upload a screenshot of your sucessful push in Bash!