Skip to content

Commit

Permalink
Add all new files
Browse files Browse the repository at this point in the history
  • Loading branch information
callaghanmt committed Jan 3, 2018
1 parent 3cda112 commit a2e0215
Show file tree
Hide file tree
Showing 52 changed files with 537 additions and 466 deletions.
36 changes: 22 additions & 14 deletions _episodes/02-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,24 @@ of configurations we will set as we get started with Git:

On a command line, Git commands are written as `git verb`,
where `verb` is what we actually want to do. So here is how
Dracula sets up his new laptop:
Jane sets up her new laptop:

~~~
$ git config --global user.name "Vlad Dracula"
$ git config --global user.email "[email protected]"
$ git config --global user.name "Jane Smith"
$ git config --global user.email "[email protected]"
$ git config --global color.ui "auto"
~~~
{: .bash}

Please use your own name and email address instead of Dracula's. This user name and email will be associated with your subsequent Git activity,
We're using a Linux 'virtual machine' today which has the command line tools for Git already installed, but Git can be used equally well on a Mac or a Windows computer:

[Git setup for Mac](https://www.codecademy.com/articles/git-setup)
[Git and Git Bash setup for Windows](https://www.codecademy.com/articles/command-line-setup)


Please use your own name and email address instead of Jane's. Later on in this workshop, we'll be setting up an account on Github so make sure you use the **same** email address. We recommend that you use your institutional email address.

This user name and email will be associated with your subsequent Git activity,
which means that any changes pushed to
[GitHub](https://github.com/),
[BitBucket](https://bitbucket.org/),
Expand All @@ -41,14 +49,14 @@ in a later lesson will include this information.

> ## Line Endings
>
> As with other keys, when you hit the 'return' key on your keyboard,
> your computer encodes this input.
> As with other keys, when you hit the 'return' key on your keyboard,
> your computer encodes this input.
> For reasons that are long to explain, different operating systems
> use different character(s) to represent the end of a line.
> use different character(s) to represent the end of a line.
> (You may also hear these referred to as newlines or line breaks.)
> Because git uses these characters to compare files,
> it may cause unexpected issues when editing a file on different machines.
>
> Because git uses these characters to compare files,
> it may cause unexpected issues when editing a file on different machines.
>
> You can change the way git recognizes and encodes line endings
> using the `core.autocrlf` command to `git config`.
> The following settings are recommended:
Expand All @@ -66,15 +74,15 @@ in a later lesson will include this information.
> $ git config --global core.autocrlf true
> ~~~
> {: .bash}
>
> You can read more about this issue
>
> You can read more about this issue
> [on this GitHub page](https://help.github.com/articles/dealing-with-line-endings/).
{: .callout}
For these lessons, we will be interacting with [GitHub](https://github.com/) and so the email address used should be the same as the one used when setting up your GitHub account. If you are concerned about privacy, please review [GitHub's instructions for keeping your email address private][git-privacy].
For these lessons, we will be interacting with [GitHub](https://github.com/) and so the email address used should be the same as the one used when setting up your GitHub account. If you are concerned about privacy, please review [GitHub's instructions for keeping your email address private][git-privacy].
If you elect to use a private email address with GitHub, then use that same email address for the `user.email` value, e.g. `[email protected]` replacing `username` with your GitHub one. You can change the email address later on by using the `git config` command again.
Dracula also has to set his favorite text editor, following this table:
Jane also has to set her favorite text editor, following this table:
| Editor | Configuration command |
|:-------------------|:-------------------------------------------------|
Expand Down
52 changes: 26 additions & 26 deletions _episodes/03-create.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ we can start using it.
Let's create a directory for our work and then move into that directory:

~~~
$ mkdir planets
$ cd planets
$ mkdir inflammation
$ cd inflammation
~~~
{: .bash}

Then we tell Git to make `planets` a [repository]({{ page.root }}/reference/#repository)—a place where
Then we tell Git to make `inflammation` a [repository]({{ page.root }}/reference/#repository)—a place where
Git can store versions of our files:

~~~
Expand Down Expand Up @@ -75,23 +75,23 @@ nothing to commit (create/copy files and use "git add" to track)

> ## Places to Create Git Repositories
>
> Dracula starts a new project, `moons`, related to his `planets` project.
> Despite Wolfman's concerns, he enters the following sequence of commands to
> Jane starts a new project, `infection`, related to her `inflammation` project.
> Despite Samit's concerns, ahe enters the following sequence of commands to
> create one Git repository inside another:
>
> ~~~
> $ cd # return to home directory
> $ mkdir planets # make a new directory planets
> $ cd planets # go into planets
> $ git init # make the planets directory a Git repository
> $ mkdir moons # make a sub-directory planets/moons
> $ cd moons # go into planets/moons
> $ git init # make the moons sub-directory a Git repository
> $ cd # return to home directory
> $ mkdir inflammation # make a new directory inflammation
> $ cd inflammation # go into inflammation
> $ git init # make the inflammation directory a Git repository
> $ mkdir infections # make a sub-directory inflammation/infection
> $ cd infection # go into inflammation/infection
> $ git init # make the infection sub-directory a Git repository
> ~~~
> {: .bash}
>
> Why is it a bad idea to do this? (Notice here that the `planets` project is now also tracking the entire `moons` repository.)
> How can Dracula undo his last `git init`?
> Why is it a bad idea to do this? (Notice here that the `inflammation` project is now also tracking the entire `infection` repository.)
> How can Jane undo her last `git init`?
>
> > ## Solution
> >
Expand All @@ -112,19 +112,19 @@ nothing to commit (create/copy files and use "git add" to track)
> > ~~~
> > {: .output}
> >
> > Note that we can track files in directories within a Git:
> > Note that we can track files in directories within a Git repository:
> >
> > ~~~
> > $ touch moon phobos deimos titan # create moon files
> > $ cd .. # return to planets directory
> > $ ls moons # list contents of the moons directory
> > $ git add moons/* # add all contents of planets/moons
> > $ git status # show moons files in staging area
> > $ git commit -m "add moon files" # commit planets/moons to planets Git repository
> > $ touch patient1 patient2 patient3 patient4 # create infection files
> > $ cd .. # return to infection directory
> > $ ls infection # list contents of the infection directory
> > $ git add infection/* # add all contents of inflammation/infection
> > $ git status # show infection files in staging area
> > $ git commit -m "add patient files" # commit inflammation/infection to inflammation Git repository
> > ~~~
> > {: .bash}
> >
> > Similarly, we can ignore (as discussed later) entire directories, such as the `moons` directory:
> > Similarly, we can ignore (as discussed later) entire directories, such as the `infection` directory:
> >
> > ~~~
> > $ nano .gitignore # open the .gitignore file in the text editor to add the moons directory
Expand All @@ -133,15 +133,15 @@ nothing to commit (create/copy files and use "git add" to track)
> > {: .bash}
> >
> > ~~~
> > moons
> > infection
> > ~~~
> > {: .output}
> >
> > To recover from this little mistake, Dracula can just remove the `.git`
> > folder in the moons subdirectory. To do so he can run the following command from inside the 'moons' directory:
> > To recover from this little mistake, Jane can just remove the `.git`
> > folder in the `infection` subdirectory. To do so she can run the following command from inside the `infection` directory:
> >
> > ~~~
> > $ rm -rf moons/.git
> > $ rm -rf .git
> > ~~~
> > {: .bash}
> >
Expand Down
Loading

0 comments on commit a2e0215

Please sign in to comment.