Skip to content

Commit c4484a7

Browse files
authored
Merge pull request #2 from anelda/anelda-episodePushPull
Added updates to Push/Pull episode
2 parents a12e124 + 373ef3d commit c4484a7

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

_episodes/04-changes.md

+34-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $ nano ToDo.txt
2626
~~~
2727
{: .bash}
2828

29-
Type the text below into the `ToDo.txt` file:
29+
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`.
3030

3131
~~~
3232
Conversion functions needed:
@@ -45,7 +45,7 @@ $ ls
4545
{: .bash}
4646

4747
~~~
48-
ToDo.txt
48+
README.md ToDo.txt
4949
~~~
5050
{: .output}
5151

@@ -156,11 +156,19 @@ $ git status
156156

157157
~~~
158158
On branch master
159+
Your branch is ahead of 'origin/master' by 1 commit.
160+
(use "git push" to publish your local commits)
159161
nothing to commit, working directory clean
160162
~~~
161163
{: .output}
162164

163-
it tells us everything is up to date.
165+
it tells us that our local repository is now differing from the
166+
origin (the repository from which we cloned this one, i.e. the original repository in Github)
167+
by one commit.
168+
169+
It also tells us that we can use the `git push` command to send our commit to the original repo in
170+
Github to synchronize these two repositories.
171+
164172
If we want to know what we've done recently,
165173
we can ask Git to show us the project's history using `git log`:
166174

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

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

197-
Now suppose we add more information to the ToDo.txt file.
205+
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`.
198206

199207
~~~
200208
$ nano ToDo.txt
209+
~~~
210+
{: .bash}
211+
212+
![Add extra lines to the existing file ToDo.txt](../fig/git-add-lines.png)
213+
214+
~~~
201215
$ cat ToDo.txt
202216
~~~
203217
{: .bash}
@@ -250,14 +264,14 @@ diff --git a/ToDo.txt b/ToDo.txt
250264
index 497e6b4..49e6774 100644
251265
--- a/ToDo.txt
252266
+++ b/ToDo.txt
253-
@@ -2,4 +2,5 @@ Conversion functions needed:
267+
@@ -3,4 +3,4 @@ Conversion functions needed:
254268
255269
- Dollars to Cents
256270
- Gallons to Liters
257-
-- Hours to Minutes
258-
\ No newline at end of file
259-
+- Hours to Minutes
271+
- Hours to Minutes
272+
-
260273
+- Feet to Inches
274+
261275
~~~
262276
{: .output}
263277

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

281295
~~~
282296
$ git commit -m "Add another desirable conversion tool"
283-
$ git status
284297
~~~
285298
{: .bash}
286299

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

350363
Let's watch as our changes to a file move from our editor
351364
to the staging area and into long-term storage.
352-
First, we'll add another line to the file:
365+
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`.
353366

354367
~~~
355368
$ nano ToDo.txt
369+
~~~
370+
{: .bash}
371+
372+
![Add extra lines to the existing file ToDo.txt](../fig/git-add-more-lines.png)
373+
374+
~~~
356375
$ cat ToDo.txt
357376
~~~
358377
{: .bash}
359378

379+
360380
~~~
361381
Conversion functions needed:
362382
@@ -445,7 +465,10 @@ $ git status
445465

446466
~~~
447467
On branch master
468+
Your branch is ahead of 'origin/master' by 3 commits.
469+
(use "git push" to publish your local commits)
448470
nothing to commit, working directory clean
471+
449472
~~~
450473
{: .output}
451474

_episodes/05-push-pull.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ $ git push
4747
{: .bash}
4848

4949
~~~
50+
Username for 'https://github.com': <ENTER YOUR GITHUB USERNAME HERE>
51+
Password for 'https://[email protected]': <ENTER YOUR GITHUB PASSWORD HERE>
52+
5053
Counting objects: 13, done.
5154
Delta compression using up to 24 threads.
5255
Compressing objects: 100% (13/13), done.
@@ -60,7 +63,8 @@ To https://github.com/biologyguy/conversions.git
6063

6164
&nbsp;
6265

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

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

fig/git-add-lines.png

37.2 KB
Loading

fig/git-add-more-lines.png

44.1 KB
Loading

0 commit comments

Comments
 (0)