Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added updates to Push/Pull episode #2

Merged
merged 15 commits into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 34 additions & 11 deletions _episodes/04-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ nano ToDo.txt
~~~
{: .bash}

Type the text below into the `ToDo.txt` file:
Type the text below into the `ToDo.txt` file. Remember to save and exit you can type `CTRL + O` (then enter) followed by `CTRL + X`.

~~~
Conversion functions needed:
Expand All @@ -45,7 +45,7 @@ $ ls
{: .bash}

~~~
ToDo.txt
README.md ToDo.txt
~~~
{: .output}

Expand Down Expand Up @@ -156,11 +156,19 @@ $ git status

~~~
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
~~~
{: .output}

it tells us everything is up to date.
it tells us that our local repository is now differing from the
origin (the repository from which we cloned this one, i.e. the original repository in Github)
by one commit.

It also tells us that we can use the `git push` command to send our commit to the original repo in
Github to synchronize these two repositories.

If we want to know what we've done recently,
we can ask Git to show us the project's history using `git log`:

Expand All @@ -187,17 +195,23 @@ Date: Thu Aug 22 09:51:46 2013 -0400

> ## Where Are My Changes?
>
> If we run `ls` at this point, we will still see just one file called `ToDo.txt`.
> If we run `ls` at this point, we will still see just two files called `README.md` and `ToDo.txt`.
> That's because Git saves information about files' history
> in the special `.git` directory mentioned earlier
> so that our filesystem doesn't become cluttered
> (and so that we can't accidentally edit or delete an old version).
{: .callout}

Now suppose we add more information to the ToDo.txt file.
Now suppose we add more information to the ToDo.txt file. Remember to save and exit the file in Nano by typing `CTRL + O` followed by `enter` and then `CTRL + X`.

~~~
$ nano ToDo.txt
~~~
{: .bash}

![Add extra lines to the existing file ToDo.txt](../fig/git-add-lines.png)

~~~
$ cat ToDo.txt
~~~
{: .bash}
Expand Down Expand Up @@ -250,14 +264,14 @@ diff --git a/ToDo.txt b/ToDo.txt
index 497e6b4..49e6774 100644
--- a/ToDo.txt
+++ b/ToDo.txt
@@ -2,4 +2,5 @@ Conversion functions needed:
@@ -3,4 +3,4 @@ Conversion functions needed:

- Dollars to Cents
- Gallons to Liters
-- Hours to Minutes
\ No newline at end of file
+- Hours to Minutes
- Hours to Minutes
-
+- Feet to Inches

~~~
{: .output}

Expand All @@ -280,7 +294,6 @@ After reviewing our change, it's time to commit it:

~~~
$ git commit -m "Add another desirable conversion tool"
$ git status
~~~
{: .bash}

Expand Down Expand Up @@ -349,14 +362,21 @@ To allow for this, Git has a special *staging area* where it keeps

Let's watch as our changes to a file move from our editor
to the staging area and into long-term storage.
First, we'll add another line to the file:
First, we'll add another line to the file. Remember to save and exit the file in Nano by typing `CTRL + O` followed by `enter` and then `CTRL + X`.

~~~
$ nano ToDo.txt
~~~
{: .bash}

![Add extra lines to the existing file ToDo.txt](../fig/git-add-more-lines.png)

~~~
$ cat ToDo.txt
~~~
{: .bash}


~~~
Conversion functions needed:

Expand Down Expand Up @@ -445,7 +465,10 @@ $ git status

~~~
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

~~~
{: .output}

Expand Down
6 changes: 5 additions & 1 deletion _episodes/05-push-pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ $ git push
{: .bash}

~~~
Username for 'https://github.com': <ENTER YOUR GITHUB USERNAME HERE>
Password for 'https://[email protected]': <ENTER YOUR GITHUB PASSWORD HERE>

Counting objects: 13, done.
Delta compression using up to 24 threads.
Compressing objects: 100% (13/13), done.
Expand All @@ -60,7 +63,8 @@ To https://github.com/biologyguy/conversions.git

&nbsp;

Now all of the changes have been uploaded to GitHub:
If you refresh your browser showing your Github repository created earlier in the lesson, it will
now show all of the changes that have been uploaded to GitHub:

![Creating a Repository on GitHub (Step 3)](../fig/github-changes-03.png)

Expand Down
Binary file added fig/git-add-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/git-add-more-lines.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.