summaryrefslogtreecommitdiff
path: root/_posts
diff options
context:
space:
mode:
Diffstat (limited to '_posts')
-rw-r--r--_posts/2011-02-15-linux-set-up-git.markdown147
-rw-r--r--_posts/2011-02-15-mac-set-up-git.markdown146
-rw-r--r--_posts/2011-02-15-set-up-git-redirect.markdown6
-rw-r--r--_posts/2011-02-15-win-set-up-git.markdown135
-rw-r--r--_posts/2011-02-16-create-a-repo.markdown22
-rw-r--r--_posts/2011-02-17-fork-a-repo.markdown80
-rw-r--r--_posts/2011-02-18-be-social.markdown4
7 files changed, 344 insertions, 196 deletions
diff --git a/_posts/2011-02-15-linux-set-up-git.markdown b/_posts/2011-02-15-linux-set-up-git.markdown
index 5f53caf..8b58ae6 100644
--- a/_posts/2011-02-15-linux-set-up-git.markdown
+++ b/_posts/2011-02-15-linux-set-up-git.markdown
@@ -28,119 +28,148 @@ _&#42;If you don&rsquo;t already know what Git is, <a href="http://progit.org/bo
##<span>Next:</span> Set Up SSH Keys
-We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involves a number of steps.
+We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involve a number of steps.
To make sure you generate a brand new key, you need to check if one already exists. First, you need to open an app called Terminal.
<img src="/images/bootcamp/bootcamp_1_linux_terminal.jpg" width="558" height="328" alt="Open the terminal" />
-<p>
<span class="explain">Need a quick lesson about Terminal?
- <span class="explain-it-shell"><span class="triangle">&nbsp;</span><span class="explain-it">Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that comes with Linux called Terminal. A line that begins with the dollar sign ($) indicates a line of code you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. If you see a line in an example that doesn&rsquo;t begin with a $ (we&rsquo;ve made them <span class="terminal-output">green</span> in the bootcamp tutorials), that means it is a line of text that terminal has output for you to read and/or act upon. In the bootcamp examples, you can roll over the lines of Bash script for an explanation of what they do.<br/><br/>
-
- <strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in the Terminal don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Terminal will let you know.<br/><br/>
-
- <strong>Good to know</strong>: For security reasons, Terminal will not display what you type when entering passwords. Just type your password and hit the return key.
- </span></span>
+ <span class="explain-it-shell">
+ <span class="triangle">&nbsp;</span>
+ <span class="explain-it">
+ <p>Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that comes with Linux called Terminal.</p>
+
+ <h4>Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo 'This is input text'<span>This tooltip tells you what's going on.</span></span>
+ </pre>
+
+ <p>A line that begins with the dollar sign ($) indicates a line of Bash script you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. You can hover your mouse over each line to see what the script is doing</p>
+
+ <h4>Output</h4>
+ <pre class="terminal bootcamp">
+ <span class="bash-output">$ This is output text.</span>
+ </pre>
+
+ <p>A line that does not begin with a $ is output text that is intended to give you information or tell you what to do next. We've colored output text green in these bootcamp tutorials.</p>
+
+ <h4>User Specific Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo '<em>username</em>'<span>Outputs the text in the quote marks.</span></span>
+ </pre>
+
+ <p>Areas of yellow text represent your own personal info. If it is part of an input ($) line, you should replace your it with your own info when you type it. If it is part of output text, it is just for your reference. It will automatically show your own info in Terminal</p>
+
+ <p><strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in the Terminal don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Terminal will let you know.</p>
+
+ <p><strong>Good to know</strong>: For security reasons, Terminal will not display what you type when entering passwords. Just type your password and hit the return key.</p>
+ </span>
+ </span>
</span>
-</p>
1. <span class="step-title">Check for SSH keys. <span>Have an existing kepair? You can skip to Step 4.</span></span>
First, we need to check for existing ssh keys on your computer:
<pre class="terminal bootcamp">
- <span class="codeline">$ cd ~/.ssh<span class="terminal-tooltip">Checks to see if there is a folder named ".ssh" in you user directory</span></span>
+ <span class="codeline">$ cd ~/.ssh<span>Checks to see if there is a folder named ".ssh" in you user directory</span></span>
</pre>
- <p class="short-bottom-marg">Does it say "No such file or directory"?</p>
- <p class="next-step"><strong>No:</strong> Go to Step 2<br /><strong>Yes:</strong> Skip to Step 3
- </p>
+ If it says &ldquo;No such file or directory&ldquo; skip to __step 3__. Otherwise continue to __step 2__.
+
2. <span class="step-title">Backup and remove existing SSH keys.</span>
Since there is already an SSH directory you&rsquo;ll want to back it up and remove it:
<pre class="terminal bootcamp">
- <span class="codeline">$ ls<span class="terminal-tooltip">Lists all the subdirectories in the current directory</span></span>
- <span class="terminal-output codeline">config id_rsa id_rsa.pub known_hosts</span>
- <span class="codeline">$ mkdir key_backup<span class="terminal-tooltip">Makes a folder called "key_backup" in the current directory</span></span>
- <span class="codeline">$ cp id_rsa* key_backup<span class="terminal-tooltip">Copies the contents of the id_rsa folder into key_backup folder</span></span>
- <span class="codeline">$ rm id_rsa*<span class="terminal-tooltip">Deletes the contents of the id_rsa folder</span></span>
+ <span class="codeline">$ ls<span>Lists all the subdirectories in the current directory</span></span>
+ <span class="bash-output">config id_rsa id_rsa.pub known_hosts</span>
+ <span class="codeline">$ mkdir key_backup<span>Makes a folder called "key_backup" in the current directory</span></span>
+ <span class="codeline">$ cp id_rsa* key_backup<span>Copies the contents of the id_rsa folder into key_backup folder</span></span>
+ <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa folder</span></span>
</pre>
3. <span class="step-title">Generate a new SSH key.</span>
- To generate a new SSH key, enter the code below. When asked to enter a file in which to save the key, just press enter without typing anything.
+ To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh-keygen -t rsa -C "octocat@github.com"<span class="terminal-tooltip">Creates a new ssh key using the provided email</span></span>
- <span class="terminal-output codeline">Generating public/private rsa key pair.</span>
- <span class="terminal-output codeline">Enter file in which to save the key (/home/octocat/.ssh/id_rsa):</span>
- <span class="terminal-output codeline">Enter passphrase (empty for no passphrase):</span>
- <span class="terminal-output codeline">Enter same passphrase again:</span>
+ <span class="codeline">$ ssh-keygen -t rsa -C "<em>user_name@username.com</em>"<span>Creates a new ssh key using the provided email</span></span>
+ <span class="bash-output">Generating public/private rsa key pair.</span>
+ <span class="bash-output">Enter file in which to save the key (/home/<em>your_user_directory</em>/.ssh/id_rsa):</span>
+ </pre>
+
+ Now you need to enter a passphrase. _[Why is this important?](../working-with-key-passphrases)_
+
+ <pre class="terminal bootcamp">
+ <span class="bash-output">Enter passphrase (empty for no passphrase):</span>
+ <span class="bash-output">Enter same passphrase again:</span>
</pre>
Which should give you something like this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Your identification has been saved in /home/octocat/.ssh/id_rsa.</span>
- <span class="terminal-output codeline">Your public key has been saved in /home/octocat/.ssh/id_rsa.pub.</span>
- <span class="terminal-output codeline">The key fingerprint is:</span>
- <span class="terminal-output codeline">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db octocat@github.com</span>
- <span class="terminal-output codeline">The key's randomart image is:</span>
- <span class="terminal-output codeline">+--[ RSA 2048]----+</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.+&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;o&nbsp;O&nbsp;.&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;*&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;S&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;o&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;.&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">+-----------------+</span>
+ <span class="bash-output">Your identification has been saved in /home/<em>your_user_directory</em>/.ssh/id_rsa.</span>
+ <span class="bash-output">Your public key has been saved in /home/<em>your_user_directory</em>/.ssh/id_rsa.pub.</span>
+ <span class="bash-output">The key fingerprint is:</span>
+ <span class="bash-output">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db <em>user_name@username.com</em></span>
+ <span class="bash-output">The key's randomart image is:</span>
+ <span class="bash-output">+--[ RSA 2048]----+</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.+&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;o&nbsp;O&nbsp;.&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;*&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;S&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;o&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;.&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">+-----------------+</span>
</pre>
4. <span class="step-title">Add your SSH key to GitHub.</span>
On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;SSH Public Keys&rdquo;_ &gt; _Click &ldquo;Add another public key&rdquo;_
- It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. To ensure this, run the following code to copy the key to your clipboard.
+ __It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace.__ To ensure this, run the following code to copy the key to your clipboard.
<pre class="terminal bootcamp">
- <span class="codeline">$ sudo apt-get install xclip<span class="terminal-tooltip">Downloads and installs xclip</span></span>
- <span class="codeline">$ cat ~/.ssh/id_rsa.pub | xclip -sel clip<span class="terminal-tooltip">Copies the contents of the id_rsa.pub file to your clipboard</span></span>
+ <span class="codeline">$ sudo apt-get install xclip<span>Downloads and installs xclip</span></span>
+ <span class="codeline">$ cat ~/.ssh/id_rsa.pub | xclip -sel clip<span>Copies the contents of the id_rsa.pub file to your clipboard</span></span>
</pre>
- Now paste it into the &ldquo;Key&rdquo; field
+ Now paste it into the &ldquo;Key&rdquo; field.
- <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" />
+ <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="402" alt="Paste your SSH Key" />
- Hit &ldquo;Add Key&rdquo;
+ Hit &ldquo;Add Key.&rdquo;
5. <span class="step-title">Test everything out.</span>
- To make sure everything is working you'll now SSH to GitHub:
+ To make sure everything is working you&rsquo;ll now SSH to GitHub. Don&rsquo;t change the &ldquo;git@github.com&rdquo; part. That&rsquo;s supposed to be there.
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">Attempts to ssh to github</span></span>
+ <span class="codeline">$ ssh git@github.com<span>Attempts to ssh to github</span></span>
</pre>
Which should give you this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
- <span class="terminal-output codeline">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
- <span class="terminal-output codeline">Are you sure you want to continue connecting (yes/no)?</span>
+ <span class="bash-output">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
+ <span class="bash-output">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
+ <span class="bash-output">Are you sure you want to continue connecting (yes/no)?</span>
</pre>
Don&rsquo;t worry, this is supposed to happen. Type &ldquo;yes&rdquo;.
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
- <span class="terminal-output codeline">ERROR: Hi octocat! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
- <span class="terminal-output codeline">Connection to github.com closed.</span>
+ <span class="bash-output">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
+ <span class="bash-output">ERROR: Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
+ <span class="bash-output">Connection to github.com closed.</span>
</pre>
+
+ You don&rsquo;t worry, about the &ldquo;ERROR&rdquo;. You actually want to see that.
##<span>Then: </span> Set Up Your Info
@@ -151,23 +180,23 @@ Now that you have Git set up and your SSH keys entered in GitHub, it&rsquo;s tim
Git tracks who makes each commit by checking the user&rsquo;s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global user.name "The Octocat"<span class="terminal-tooltip">Sets the name of the user for all git instances on the system</span></span>
- <span class="codeline">$ git config --global user.email "octocat@github.com"<span class="terminal-tooltip">Sets the email of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.name "<em>Firstname Lastname</em>"<span>Sets the name of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.email "<em>user_name@username.com</em>"<span>Sets the email of the user for all git instances on the system</span></span>
</pre>
2. <span class="step-title">Set your GitHub token.</span>
Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token.
- On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin&rdquo;_
+ On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin.&rdquo;_
<img src="/images/bootcamp/bootcamp_1_token.jpg" width="558" height="245" alt="Copy your API token" />
In Terminal, run the following code, using your GitHub username and token in place of the ones shown.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global github.user octocat<span class="terminal-tooltip">Sets the GitHub username for all git instances on the system</span></span>
- <span class="codeline">$ git config --global github.token 0123456789abcdef0123456789abcdef<span class="terminal-tooltip">Sets the GitHub token for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.user <em>username</em><span>Sets the GitHub username for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.token <em>0123456789your0123456789token</em><span>Sets the GitHub token for all git instances on the system</span></span>
</pre>
__&#42;Note&#42;__ If you ever change your GitHub password, a new token will be created and will need to be updated.
diff --git a/_posts/2011-02-15-mac-set-up-git.markdown b/_posts/2011-02-15-mac-set-up-git.markdown
index a4d3ef6..a35e587 100644
--- a/_posts/2011-02-15-mac-set-up-git.markdown
+++ b/_posts/2011-02-15-mac-set-up-git.markdown
@@ -18,119 +18,147 @@ _&#42;If you don&rsquo;t already know what Git is, <a href="http://progit.org/bo
##<span>Next:</span> Set Up SSH Keys
-We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involves a number of steps.
+We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involve a number of steps.
To make sure you generate a brand new key, you need to check if one already exists. First, you need to open Terminal.app, usually found at /Applications/Utilities.
<img src="/images/bootcamp/bootcamp_1_mac_terminal.jpg" width="558" height="200" alt="Open the terminal" />
-<p>
-<span class="explain">Need a quick lesson on Terminal?
- <span class="explain-it-shell"><span class="triangle">&nbsp;</span><span class="explain-it">Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that comes with your Mac called Terminal.app. A line that begins with the dollar sign ($) indicates a line of code you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. If you see a line in an example that doesn&rsquo;t begin with a $ (we&rsquo;ve made them <span class="terminal-output">green</span> in the bootcamp tutorials), that means it is a line of text that terminal has output for you to read and/or act upon. In the bootcamp examples, you can roll over the lines of Bash script for an explanation of what they do.<br/><br/>
+<div class="more-info">
+ <h4 class="compressed">Need a quick lesson about Terminal?</h4>
+ <div class="more-content">
+ <p>Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that comes with Linux called Terminal.</p>
+
+ <h4>Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo 'This is input text'<span>This tooltip tells you what's going on.</span></span>
+ </pre>
+
+ <p>A line that begins with the dollar sign ($) indicates a line of Bash script you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. You can hover your mouse over each line to see what the script is doing</p>
+
+ <h4>Output</h4>
+ <pre class="terminal bootcamp">
+ <span class="bash-output">$ This is output text.</span>
+ </pre>
+
+ <p>A line that does not begin with a $ is output text that is intended to give you information or tell you what to do next. We've colored output text green in these bootcamp tutorials.</p>
+
+ <h4>User Specific Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo '<em>username</em>'<span>Outputs the text in the quote marks.</span></span>
+ </pre>
+
+ <p>Areas of yellow text represent your own personal info. If it is part of an input ($) line, you should replace your it with your own info when you type it. If it is part of output text, it is just for your reference. It will automatically show your own info in Terminal</p>
+
+ <p><strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in the Terminal don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Terminal will let you know.</p>
- <strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in the Terminal don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Terminal will let you know.<br/><br/>
-
- <strong>Good to know</strong>: For security reasons, Terminal will not display what you type when entering passwords. Just type your password and hit the return key.
- </span></span>
-</span>
-</p>
+ <p><strong>Good to know</strong>: For security reasons, Terminal will not display what you type when entering passwords. Just type your password and hit the return key.</p>
+ </div>
+</div>
1. <span class="step-title">Check for SSH keys. <span>Have an existing kepair? You can skip to Step 4.</span></span>
First, we need to check for existing ssh keys on your computer:
<pre class="terminal bootcamp">
- <span class="codeline">$ cd ~/.ssh<span class="terminal-tooltip">Checks to see if there is a folder named ".ssh" in you user directory</span></span>
+ <span class="codeline">$ cd ~/.ssh<span>Checks to see if there is a folder named ".ssh" in you user directory</span></span>
</pre>
- <p class="short-bottom-marg">Does it say "No such file or directory"?</p>
- <p class="next-step"><strong>No:</strong> Go to Step 2<br /><strong>Yes:</strong> Skip to Step 3
- </p>
+ If it says &ldquo;No such file or directory&ldquo; skip to __step 3__. Otherwise continue to __step 2__.
+
2. <span class="step-title">Backup and remove existing SSH keys.</span>
Since there is already an SSH directory you&rsquo;ll want to back it up and remove it:
<pre class="terminal bootcamp">
- <span class="codeline">$ ls<span class="terminal-tooltip">Lists all the subdirectories in the current directory</span></span>
- <span class="terminal-output codeline">config id_rsa id_rsa.pub known_hosts</span>
- <span class="codeline">$ mkdir key_backup<span class="terminal-tooltip">Makes a folder called "key_backup" in the current directory</span></span>
- <span class="codeline">$ cp id_rsa* key_backup<span class="terminal-tooltip">Copies the contents of the id_rsa folder into key_backup folder</span></span>
- <span class="codeline">$ rm id_rsa*<span class="terminal-tooltip">Deletes the contents of the id_rsa folder</span></span>
+ <span class="codeline">$ ls<span>Lists all the subdirectories in the current directory</span></span>
+ <span class="bash-output">config id_rsa id_rsa.pub known_hosts</span>
+ <span class="codeline">$ mkdir key_backup<span>Makes a folder called "key_backup" in the current directory</span></span>
+ <span class="codeline">$ cp id_rsa* key_backup<span>Copies the contents of the id_rsa folder into key_backup folder</span></span>
+ <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa folder</span></span>
</pre>
3. <span class="step-title">Generate a new SSH key.</span>
- To generate a new SSH key, enter the code below. When asked to enter a file in which to save the key, just press enter without typing anything.
+ To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
+
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ ssh-keygen -t rsa -C "<em>your_email@youremail.com</em>"<span>Creates a new ssh key using the provided email</span></span>
+ <span class="bash-output">Generating public/private rsa key pair.</span>
+ <span class="bash-output">Enter file in which to save the key (/Users/<em>your_user_directory</em>/.ssh/id_rsa):</span>
+ </pre>
+
+ Now you need to enter a passphrase. _[Why is this important?](../working-with-key-passphrases)_
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh-keygen -t rsa -C "octocat@github.com"<span class="terminal-tooltip">Creates a new ssh key using the provided email</span></span>
- <span class="terminal-output codeline">Generating public/private rsa key pair.</span>
- <span class="terminal-output codeline">Enter file in which to save the key (/Users/octocat/.ssh/id_rsa):</span>
- <span class="terminal-output codeline">Enter passphrase (empty for no passphrase):</span>
- <span class="terminal-output codeline">Enter same passphrase again:</span>
+ <span class="bash-output">Enter passphrase (empty for no passphrase):</span>
+ <span class="bash-output">Enter same passphrase again:</span>
</pre>
Which should give you something like this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Your identification has been saved in /Users/octocat/.ssh/id_rsa.</span>
- <span class="terminal-output codeline">Your public key has been saved in /Users/octocat/.ssh/id_rsa.pub.</span>
- <span class="terminal-output codeline">The key fingerprint is:</span>
- <span class="terminal-output codeline">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db octocat@github.com</span>
- <span class="terminal-output codeline">The key's randomart image is:</span>
- <span class="terminal-output codeline">+--[ RSA 2048]----+</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.+&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;o&nbsp;O&nbsp;.&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;*&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;S&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;o&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;.&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
- <span class="terminal-output codeline">+-----------------+</span>
+ <span class="bash-output">Your identification has been saved in /Users/<em>your_user_directory</em>/.ssh/id_rsa.</span>
+ <span class="bash-output">Your public key has been saved in /Users/<em>your_user_directory</em>/.ssh/id_rsa.pub.</span>
+ <span class="bash-output">The key fingerprint is:</span>
+ <span class="bash-output">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db <em>user_name@username.com</em></span>
+ <span class="bash-output">The key's randomart image is:</span>
+ <span class="bash-output">+--[ RSA 2048]----+</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.+&nbsp;&nbsp;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;o&nbsp;O&nbsp;.&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;*&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;=&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;S&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;o&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;o&nbsp;.&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</span>
+ <span class="bash-output">+-----------------+</span>
</pre>
4. <span class="step-title">Add your SSH key to GitHub.</span>
On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;SSH Public Keys&rdquo;_ &gt; _Click &ldquo;Add another public key&rdquo;_
- It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. To ensure this, run the following code to copy the key to your clipboard.
+ __It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace.__ To ensure this, run the following code to copy the key to your clipboard.
<pre class="terminal bootcamp">
- <span class="codeline">$ cat ~/.ssh/id_rsa.pub | pbcopy<span class="terminal-tooltip">Copies the contents of the id_rsa.pub file to your clipboard</span></span>
+ <span class="codeline">$ cat ~/.ssh/id_rsa.pub | pbcopy<span>Copies the contents of the id_rsa.pub file to your clipboard</span></span>
</pre>
- Now paste it into the &ldquo;Key&rdquo; field
+ Now paste it into the &ldquo;Key&rdquo; field.
- <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" />
+ <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="402" alt="Paste your SSH Key" />
- Hit &ldquo;Add Key&rdquo;
+ Hit &ldquo;Add Key.&rdquo;
5. <span class="step-title">Test everything out.</span>
- To make sure everything is working you'll now SSH to GitHub:
+ To make sure everything is working you&rsquo;ll now SSH to GitHub. Don&rsquo;t change the &ldquo;git@github.com&rdquo; part. That&rsquo;s supposed to be there.
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">Attempts to ssh to github</span></span>
+ <span class="codeline">$ ssh git@github.com<span>Attempts to ssh to github</span></span>
</pre>
Which should give you this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
- <span class="terminal-output codeline">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
- <span class="terminal-output codeline">Are you sure you want to continue connecting (yes/no)?</span>
+ <span class="bash-output">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
+ <span class="bash-output">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
+ <span class="bash-output">Are you sure you want to continue connecting (yes/no)?</span>
</pre>
Don&rsquo;t worry, this is supposed to happen. Type &ldquo;yes&rdquo;.
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
- <span class="terminal-output codeline">ERROR: Hi octocat! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
- <span class="terminal-output codeline">Connection to github.com closed.</span>
+ <span class="bash-output">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
+ <span class="bash-output">ERROR: Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
+ <span class="bash-output">Connection to github.com closed.</span>
</pre>
+ You don&rsquo;t worry, about the &ldquo;ERROR&rdquo;. You actually want to see that.
+
+
##<span>Then: </span> Set Up Your Info
Now that you have Git set up and your SSH keys entered in GitHub, it&rsquo;s time to configure your personal info.
@@ -140,23 +168,23 @@ Now that you have Git set up and your SSH keys entered in GitHub, it&rsquo;s tim
Git tracks who makes each commit by checking the user&rsquo;s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global user.name "The Octocat"<span class="terminal-tooltip">Sets the name of the user for all git instances on the system</span></span>
- <span class="codeline">$ git config --global user.email "octocat@github.com"<span class="terminal-tooltip">Sets the email of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.name "<em>Firstname Lastname</em>"<span>Sets the name of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.email "<em>your_email@youremail.com</em>"<span>Sets the email of the user for all git instances on the system</span></span>
</pre>
2. <span class="step-title">Set your GitHub token.</span>
Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token.
- On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin&rdquo;_
+ On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin.&rdquo;_
<img src="/images/bootcamp/bootcamp_1_token.jpg" width="558" height="245" alt="Copy your API token" />
In Terminal, run the following code, using your GitHub username and token in place of the ones shown.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global github.user octocat<span class="terminal-tooltip">Sets the GitHub username for all git instances on the system</span></span>
- <span class="codeline">$ git config --global github.token 0123456789abcdef0123456789abcdef<span class="terminal-tooltip">Sets the GitHub token for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.user <em>username</em><span>Sets the GitHub username for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.token <em>0123456789yourf0123456789token</em><span>Sets the GitHub token for all git instances on the system</span></span>
</pre>
__&#42;Note&#42;__ If you ever change your GitHub password, a new token will be created and will need to be updated.
diff --git a/_posts/2011-02-15-set-up-git-redirect.markdown b/_posts/2011-02-15-set-up-git-redirect.markdown
index 860abc0..8209e30 100644
--- a/_posts/2011-02-15-set-up-git-redirect.markdown
+++ b/_posts/2011-02-15-set-up-git-redirect.markdown
@@ -13,7 +13,7 @@ Attempting to redirect to the guide for your OS. If the redirect fails, pick yo
* [Linux](linux-set-up-git)
<script type="text/javascript">
- if (navigator.appVersion.indexOf("Win") != -1) {window.location = 'http://help.github.com/win-set-up-git/'}
- else if (navigator.appVersion.indexOf("Mac") != -1) {window.location = 'http://help.github.com/mac-set-up-git/'}
- else if (navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) {window.location = 'http://help.github.com/linux-set-up-git/'}
+ if (navigator.appVersion.indexOf("Win") != -1) {window.location = '/win-set-up-git'}
+ else if (navigator.appVersion.indexOf("Mac") != -1) {window.location = '/mac-set-up-git'}
+ else if (navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) {window.location = '/linux-set-up-git'}
</script> \ No newline at end of file
diff --git a/_posts/2011-02-15-win-set-up-git.markdown b/_posts/2011-02-15-win-set-up-git.markdown
index bdbf163..e1a8878 100644
--- a/_posts/2011-02-15-win-set-up-git.markdown
+++ b/_posts/2011-02-15-win-set-up-git.markdown
@@ -14,103 +14,146 @@ _&#42;If you don&rsquo;t already know what Git is, <a href="http://progit.org/bo
1. <span class="step-title">Download and install the latest version of <a href="http://code.google.com/p/msysgit/downloads/list" target="_blank">msysgit</a>.</span>
- Use the default options for each step. Do not use PuTTY if you are given the option. GitHub only provides support for openssh.
+ Use the default options for each step.
+
+ <img src="/images/bootcamp/bootcamp_1_win_install_1.jpg" width="558" height="442" alt="Welcome page" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_2.jpg" width="558" height="442" alt="Information" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_3.jpg" width="558" height="442" alt="Select destination location" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_4.jpg" width="558" height="442" alt="Select start menu folder" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_5.jpg" width="558" height="442" alt="Select components" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_6.jpg" width="558" height="442" alt="Adjusting your PATH environment" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_7.jpg" width="558" height="442" alt="Configuring the line ending conversions" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_8.jpg" width="558" height="442" alt="Installing" />
+ <img src="/images/bootcamp/bootcamp_1_win_install_9.jpg" width="558" height="442" alt="Installation complete" />
+
+
+ __Do not use PuTTY if you are given the option. GitHub only provides support for openssh.__
##<span>Next:</span> Set Up SSH Keys
-We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involves a number of steps.
+We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy, but does involve a number of steps.
To make sure you generate a brand new key, you need to check if one already exists. First, you need to open Git Bash (not the Windows command line), found in the start menu in the git.
<img src="/images/bootcamp/bootcamp_1_win_gitbash.jpg" width="558" height="300" alt="Open the terminal" />
-<p>
-<span class="explain">Need a quick lesson on Git Bash?
- <span class="explain-it-shell"><span class="triangle">&nbsp;</span><span class="explain-it">Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that was installed with msysgit called Git Bash (There is probably an shortcut on your desktop). A line that begins with the dollar sign ($) indicates a line of code you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. If you see a line in an example that doesn&rsquo;t begin with a $ (we&rsquo;ve made them <span class="terminal-output">green</span> in the bootcamp tutorials), that means it is a line of text that Git Bash has output for you to read and/or act upon. In the bootcamp examples, you can roll over the lines of Bash script for an explanation of what they do.<br/><br/>
-
- <strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in Git Bash don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Git Bash will let you know.<br/><br/>
-
- <strong>Good to know</strong>: For security reasons, Git Bash will not display what you type when entering passwords. Just type your password and hit the return key.
- </span></span>
+<span class="explain">Need a quick lesson about Terminal?
+ <span class="explain-it-shell">
+ <span class="triangle">&nbsp;</span>
+ <span class="explain-it">
+ <p>Code blocks like those on this page are part of a scripting language called Bash. To use Bash scripts, we need to use an application that comes with Linux called Terminal.</p>
+
+ <h4>Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo 'This is input text'<span>This tooltip tells you what's going on.</span></span>
+ </pre>
+
+ <p>A line that begins with the dollar sign ($) indicates a line of Bash script you need to type. To enter it, type the text that follows the $, hitting the return key at the end of each line. You can hover your mouse over each line to see what the script is doing</p>
+
+ <h4>Output</h4>
+ <pre class="terminal bootcamp">
+ <span class="bash-output">$ This is output text.</span>
+ </pre>
+
+ <p>A line that does not begin with a $ is output text that is intended to give you information or tell you what to do next. We've colored output text green in these bootcamp tutorials.</p>
+
+ <h4>User Specific Input</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ echo '<em>username</em>'<span>Outputs the text in the quote marks.</span></span>
+ </pre>
+
+ <p>Areas of yellow text represent your own personal info. If it is part of an input ($) line, you should replace your it with your own info when you type it. If it is part of output text, it is just for your reference. It will automatically show your own info in Terminal</p>
+
+ <p><strong>Good to know</strong>: There will be times when you type code, hit return, and all you are given is another prompt. Some actions that you execute in the Terminal don&rsquo;t have any output. Don&rsquo;t worry, if there is ever a problem with your code, Terminal will let you know.</p>
+
+ <p><strong>Good to know</strong>: For security reasons, Terminal will not display what you type when entering passwords. Just type your password and hit the return key.</p>
+ </span>
+ </span>
</span>
-</p>
+
1. <span class="step-title">Check for SSH keys. <span>Have an existing kepair? You can skip to Step 4.</span></span>
First, we need to check for existing ssh keys on your computer:
<pre class="terminal bootcamp">
- <span class="codeline">$ cd ~/.ssh<span class="terminal-tooltip">Checks to see if there is a folder named ".ssh" in you user directory</span></span>
+ <span class="codeline">$ cd ~/.ssh<span>Checks to see if there is a folder named ".ssh" in you user directory</span></span>
</pre>
- <p class="short-bottom-marg">Does it say "No such file or directory"?</p>
- <p class="next-step"><strong>No:</strong> Go to Step 2<br /><strong>Yes:</strong> Skip to Step 3
- </p>
+ If it says &ldquo;No such file or directory&ldquo; skip to __step 3__. Otherwise continue to __step 2__.
+
2. <span class="step-title">Backup and remove existing SSH keys.</span>
Since there is already an SSH directory you&rsquo;ll want to back it up and remove it:
<pre class="terminal bootcamp">
- <span class="codeline">$ ls<span class="terminal-tooltip">Lists all the subdirectories in the current directory</span></span>
- <span class="terminal-output codeline">config id_rsa id_rsa.pub known_hosts</span>
- <span class="codeline">$ mkdir key_backup<span class="terminal-tooltip">Makes a folder called "key_backup" in the current directory</span></span>
- <span class="codeline">$ cp id_rsa* key_backup<span class="terminal-tooltip">Copies the contents of the id_rsa folder into key_backup folder</span></span>
- <span class="codeline">$ rm id_rsa*<span class="terminal-tooltip">Deletes the contents of the id_rsa folder</span></span>
+ <span class="codeline">$ ls<span>Lists all the subdirectories in the current directory</span></span>
+ <span class="bash-output">config id_rsa id_rsa.pub known_hosts</span>
+ <span class="codeline">$ mkdir key_backup<span>Makes a folder called "key_backup" in the current directory</span></span>
+ <span class="codeline">$ cp id_rsa* key_backup<span>Copies the contents of the id_rsa folder into key_backup folder</span></span>
+ <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa folder</span></span>
</pre>
3. <span class="step-title">Generate a new SSH key.</span>
- To generate a new SSH key, enter the code below. When asked to enter a file in which to save the key, just press enter without typing anything.
+ To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
+
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ ssh-keygen -t rsa -C "<em>user_name@username.com</em>"<span>Creates a new ssh key using the provided email</span></span>
+ <span class="bash-output">Generating public/private rsa key pair.</span>
+ <span class="bash-output">Enter file in which to save the key (/c/Users/<em>your_user_directory</em>/.ssh/id_rsa):</span>
+ </pre>
+
+ Now you need to enter a passphrase. _[Why is this important?](../working-with-key-passphrases)_
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh-keygen -t rsa -C "octocat@github.com"<span class="terminal-tooltip">Creates a new ssh key using the provided email</span></span>
- <span class="terminal-output codeline">Generating public/private rsa key pair.</span>
- <span class="terminal-output codeline">Enter file in which to save the key (/c/Users/octocat/.ssh/id_rsa):</span>
- <span class="terminal-output codeline">Enter passphrase (empty for no passphrase):</span>
- <span class="terminal-output codeline">Enter same passphrase again:</span>
+ <span class="bash-output">Enter passphrase (empty for no passphrase):</span>
+ <span class="bash-output">Enter same passphrase again:</span>
</pre>
Which should give you something like this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Your identification has been saved in /c/Users/octocat/.ssh/id_rsa.</span>
- <span class="terminal-output codeline">Your public key has been saved in /c/Users/octocat/.ssh/id_rsa.pub.</span>
- <span class="terminal-output codeline">The key fingerprint is:</span>
- <span class="terminal-output codeline">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db octocat@github.com</span>
+ <span class="bash-output">Your identification has been saved in /c/Users/<em>your_user_directory</em>/.ssh/id_rsa.</span>
+ <span class="bash-output">Your public key has been saved in /c/Users/<em>your_user_directory</em>/.ssh/id_rsa.pub.</span>
+ <span class="bash-output">The key fingerprint is:</span>
+ <span class="bash-output">01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db <em>user_name@username.com</em></span>
</pre>
4. <span class="step-title">Add your SSH key to GitHub.</span>
On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;SSH Public Keys&rdquo;_ &gt; _Click &ldquo;Add another public key&rdquo;_
- First, open the id_rsa.pub file with a text editor (Notepad will do just fine). This is your SSH key. It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. Now paste it into the &ldquo;Key&rdquo; field
+ First, open the id_rsa.pub file with a text editor (Notepad will do just fine). This is your SSH key. __It&rsquo;s important you copy your SSH key exactly as it is written without adding any newlines or whitespace.__ Now paste it into the &ldquo;Key&rdquo; field.
- <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" />
+ <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="402" alt="Paste your SSH Key" />
- Hit &ldquo;Add Key&rdquo;
+ Hit &ldquo;Add Key.&rdquo;
5. <span class="step-title">Test everything out.</span>
- To make sure everything is working you'll now SSH to GitHub:
+ To make sure everything is working you&rsquo;ll now SSH to GitHub. Don&rsquo;t change the &ldquo;git@github.com&rdquo; part. That&rsquo;s supposed to be there.
<pre class="terminal bootcamp">
- <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">Attempts to ssh to github</span></span>
+ <span class="codeline">$ ssh git@github.com<span>Attempts to ssh to github</span></span>
</pre>
Which should give you this:
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
- <span class="terminal-output codeline">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
- <span class="terminal-output codeline">Are you sure you want to continue connecting (yes/no)?</span>
+ <span class="bash-output">The authenticity of host 'github.com (207.97.227.239)' can't be established.</span>
+ <span class="bash-output">RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.</span>
+ <span class="bash-output">Are you sure you want to continue connecting (yes/no)?</span>
</pre>
Don&rsquo;t worry, this is supposed to happen. Type &ldquo;yes&rdquo;.
<pre class="terminal bootcamp">
- <span class="terminal-output codeline">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
- <span class="terminal-output codeline">ERROR: Hi octocat! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
- <span class="terminal-output codeline">Connection to github.com closed.</span>
+ <span class="bash-output">Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.</span>
+ <span class="bash-output">ERROR: Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide <br />shell access</span>
+ <span class="bash-output">Connection to github.com closed.</span>
</pre>
+
+ You don&rsquo;t worry, about the &ldquo;ERROR&rdquo;. You actually want to see that.
##<span>Then: </span> Set Up Your Info
@@ -121,23 +164,23 @@ Now that you have Git set up and your SSH keys entered in GitHub, it&rsquo;s tim
Git tracks who makes each commit by checking the user&rsquo;s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your _actual name_, not your GitHub username.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global user.name "The Octocat"<span class="terminal-tooltip">Sets the name of the user for all git instances on the system</span></span>
- <span class="codeline">$ git config --global user.email "octocat@github.com"<span class="terminal-tooltip">Sets the email of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.name "<em>Firstname Lastname</em>"<span>Sets the name of the user for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global user.email "<em>user_name@username.com</em>"<span>Sets the email of the user for all git instances on the system</span></span>
</pre>
2. <span class="step-title">Set your GitHub token.</span>
Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token.
- On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin&rdquo;_
+ On the GitHub site _Click &ldquo;Account Settings&rdquo;_ &gt; _Click &ldquo;Account Admin.&rdquo;_
<img src="/images/bootcamp/bootcamp_1_token.jpg" width="558" height="245" alt="Copy your API token" />
In Git Bash, run the following code, using your GitHub username and token in place of the ones shown.
<pre class="terminal bootcamp">
- <span class="codeline">$ git config --global github.user octocat<span class="terminal-tooltip">Sets the GitHub username for all git instances on the system</span></span>
- <span class="codeline">$ git config --global github.token 0123456789abcdef0123456789abcdef<span class="terminal-tooltip">Sets the GitHub token for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.user <em>username</em><span>Sets the GitHub username for all git instances on the system</span></span>
+ <span class="codeline">$ git config --global github.token <em>0123456789your0123456789token</em><span>Sets the GitHub token for all git instances on the system</span></span>
</pre>
__&#42;Note&#42;__ If you ever change your GitHub password, a new token will be created and will need to be updated.
diff --git a/_posts/2011-02-16-create-a-repo.markdown b/_posts/2011-02-16-create-a-repo.markdown
index 3cd470a..ac8af10 100644
--- a/_posts/2011-02-16-create-a-repo.markdown
+++ b/_posts/2011-02-16-create-a-repo.markdown
@@ -14,11 +14,11 @@ Every time you push your commits to GitHub, they get stored in a repository (a.k
1. <span class="step-title">Create a new repo</span>
- Click &ldquo;New Repository
+ Click &ldquo;New Repository.
<img src="/images/bootcamp/bootcamp_2_newrepo.jpg" width="558" height="291" alt="Click &ldquo;New Repository" />
- Fill out the information on this page. When you&rsquo;re done, click &ldquo;Create Repository&rdquo;
+ Fill out the information on this page. When you&rsquo;re done, click &ldquo;Create Repository.&rdquo;
<img src="/images/bootcamp/bootcamp_2_repoinfo.jpg" width="558" height="437" alt="Fill in the info" />
@@ -33,11 +33,11 @@ While a README isn&rsquo;t a required part of a GitHub repo, it is a good idea t
In the prompt, type the following code:
<pre class="terminal bootcamp">
- <span class="codeline">$ mkdir ~/Hello-World<span class="terminal-tooltip">Creates a folder for your project called "Hello-World" in your user folder</span></span>
- <span class="codeline">$ cd ~/Hello-World<span class="terminal-tooltip">Changes the active directory in the prompt to your newly created folder</span></span>
- <span class="codeline">$ git init<span class="terminal-tooltip">Sets up the necessary Git files</span></span>
- <span class="codeline terminal-output">Initialized empty Git repository in /Users/octocat/Hello-World/.git/</span>
- <span class="codeline">$ touch README<span class="terminal-tooltip">Creates a file called "README" in your Hello-World folder</span></span>
+ <span class="codeline">$ mkdir ~/Hello-World<span>Creates a folder for your project called "Hello-World" in your user folder</span></span>
+ <span class="codeline">$ cd ~/Hello-World<span>Changes the active directory in the prompt to your newly created folder</span></span>
+ <span class="codeline">$ git init<span>Sets up the necessary Git files</span></span>
+ <span class="terminal-output">Initialized empty Git repository in /Users/<em>your_user_directory</em>/Hello-World/.git/</span>
+ <span class="codeline">$ touch README<span>Creates a file called "README" in your Hello-World folder</span></span>
</pre>
Open the new README file found in your Hello-World folder in a text editor and add the text &ldquo;Hello World!.&rdquo; When you are finished, save and close the file.
@@ -47,15 +47,15 @@ While a README isn&rsquo;t a required part of a GitHub repo, it is a good idea t
Now that you have your README set up, it's time to commit it. A commit is essentially a snapshot of all the files in your project at a particular point in time. In the prompt, type the following code:
<pre class="terminal bootcamp">
- <span class="codeline">$ git add README<span class="terminal-tooltip">Stages your README file, adding it to the list of files to be committed</span></span>
- <span class="codeline">$ git commit -m 'first commit'<span class="terminal-tooltip"></span>Commits your files, adding the message "first commit"</span>
+ <span class="codeline">$ git add README<span>Stages your README file, adding it to the list of files to be committed</span></span>
+ <span class="codeline">$ git commit -m 'first commit'<span></span>Commits your files, adding the message "first commit"</span>
</pre>
The code above executes actions locally, meaning you still haven&rsquo;t done anything on GitHub yet. To connect your local repository to your GitHub account, you will need to set a remote for your repo and push your commits to it:
<pre class="terminal bootcamp">
- <span class="codeline">$ git remote add origin git@github.com:octocat/Hello-World.git<span class="terminal-tooltip">Sets the origin for the Hello-World repo</span></span>
- <span class="codeline">$ git push origin master<span class="terminal-tooltip"></span>Sends your commit to GitHub</span>
+ <span class="codeline">$ git remote add origin git@github.com:<em>username</em>/Hello-World.git<span>Sets the origin for the Hello-World repo</span></span>
+ <span class="codeline">$ git push origin master<span></span>Sends your commit to GitHub</span>
</pre>
Now if you look at your repository on GitHub, you will see your README has been added to it.
diff --git a/_posts/2011-02-17-fork-a-repo.markdown b/_posts/2011-02-17-fork-a-repo.markdown
index 4e8878c..29fd3e4 100644
--- a/_posts/2011-02-17-fork-a-repo.markdown
+++ b/_posts/2011-02-17-fork-a-repo.markdown
@@ -6,41 +6,39 @@ categories: bootcamp
main_category: bootcamp
---
-<span class="intro">If you&rsquo;ve found yourself on this page, we&rsquo;re assuming you&rsquo;re brand new to Git and GitHub. At some point you may want use another user&rsquo;s project as the starting point for your own. This is known as "forking."</span>
+<span class="intro">If you&rsquo;ve found yourself on this page, we&rsquo;re assuming you&rsquo;re brand new to Git and GitHub. At some point you may want use another user&rsquo;s project as the starting point for your own. This is known as &ldquo;forking.&rdquo;</span>
##<span>First:</span> Fork A Repo
-For this tutorial, we'll be using the <a href="https://github.com/octocat/Fork-it" target="_blank">Fork It</a> project.
+For this tutorial, we&rsquo;ll be using the <a href="https://github.com/octocat/Spoon-Knife" target="_blank">Spoon-Knife</a> project.
-1. <span class="step-title">Fork the &ldquo;Fork It &rdquo; repo</span>
+1. <span class="step-title">Fork the &ldquo;Spoon-Knife &rdquo; repo</span>
- To fork this project, click the "Fork" button.
+ To fork this project, click the &ldquo;Fork&rdquo; button.
<img src="/images/bootcamp/bootcamp_3_fork.jpg" width="558" height="137" alt="Click &ldquo;Fork" />
##Next: Set Up Your Local Repo
-You&rsquo;ve successfully forked the Fork It repo, but so far it only exists on GitHub. To be able to work on the project, you will need to clone it to your local machine.
+You&rsquo;ve successfully forked the Spoon-Knife repo, but so far it only exists on GitHub. To be able to work on the project, you will need to clone it to your local machine.
-1. <span class="step-title">Clone the &ldquo;Fork It &rdquo; project</span>
+1. <span class="step-title">Clone the &ldquo;Spoon-Knife&rdquo; project</span>
Run the following code:
<pre class="terminal bootcamp">
- <span class="codeline">$ git clone git@github.com:octocat/Fork-it.git<span class="terminal-tooltip">Clones the linked repo into the current folder</span></span>
+ <span class="codeline">$ git clone git@github.com:<em>username</em>/Spoon-Knife.git<span>Clones your copy of the repo into the current folder in terminal</span></span>
</pre>
2. <span class="step-title">Configure remotes</span>
- Each repository has a default remote&#42; called `origin`. The origin remote in your new cloned repo points to your fork on GitHub, not the original repo it was forked from. To help you keep track of the original repo, you will add another remote named `upstream`:
+ Each repo has a default remote called `origin`. A &ldquo;remote&rdquo; is a repo stored on another computer, in this case on GitHub's server. The `origin` remote in your local repo points to your fork on GitHub, not the original repo it was forked from. To help you keep track of the original repo, you will add another remote named `upstream`:
<pre class="terminal bootcamp">
- <span class="codeline">$ cd Fork-it<span class="terminal-tooltip">Changes the active directory in the prompt to the newly cloned "Fork-it" directory</span></span>
- <span class="codeline">$ git remote add upstream git://github.com/octocat/Fork-it.git<span class="terminal-tooltip">Creates a remote called "upstream" and assigns it the original repo URL</span></span>
- <span class="codeline">$ git fetch upstream<span class="terminal-tooltip">Pulls in any changes not present in your local repository, but doesn't modify your working files</span></span>
+ <span class="codeline">$ cd Spoon-Knife<span>Changes the active directory in the prompt to the newly cloned "Spoon-Knife" directory</span></span>
+ <span class="codeline">$ git remote add upstream git://github.com/octocat/Spoon-Knife.git<span>Assigns the original repo to a remote called "upstream"</span></span>
+ <span class="codeline">$ git fetch upstream<span>Pulls in any changes not present in your local repository, but doesn't modify your working files</span></span>
</pre>
-
- &#42;A &ldquo;remote&rdquo; is a reference to the GitHub URL where your commits are stored.
##<span>Then:</span> More Things You Can Do
@@ -51,7 +49,7 @@ Congratulations, you&rsquo;ve successfully forked a repo, but get a load of thes
Once you&rsquo;ve made some commits to a forked repo and want to push it to your forked project, you do it the same way you would with a regular repo:
<pre class="terminal bootcamp">
- <span class="codeline">$ git push origin master<span class="terminal-tooltip">Pushes commits to GitHub</span></span>
+ <span class="codeline">$ git push origin master<span>Pushes commits to your remote repo stored on GitHub</span></span>
</pre>
- <span class="step-title">Pull in upstream changes</span>
@@ -59,10 +57,60 @@ Congratulations, you&rsquo;ve successfully forked a repo, but get a load of thes
If the original repo you forked your project from gets updated, you can add those updates to your fork by running the following code:
<pre class="terminal bootcamp">
- <span class="codeline">$ git fetch upstream<span class="terminal-tooltip">Fetches any new changes from the original repo</span></span>
- <span class="codeline">$ git merge upstream/master<span class="terminal-tooltip">Merges any changes fetched into your working files</span></span>
+ <span class="codeline">$ git fetch upstream<span>Fetches any new changes from the original repo</span></span>
+ <span class="codeline">$ git merge upstream/master<span>Merges any changes fetched into your working files</span></span>
</pre>
+
+ <div class="more-info">
+ <h4 class="compressed">What is the difference between fetch and pull?</h4>
+ <div class="more-content">
+ <p>
+ There are two ways to get changes from a remote repo or branch: <code>fetch</code> and <code>pull</code>. While they might seem similar at first, there are distinct differences you should consider.
+ </p>
+ <h4>Pull</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ git pull upstream<span>Pulls changes from upstream and adds them to the local repo</span></span>
+ </pre>
+ <p>When you use <code>pull</code>, Git tries to automatically do your work for you. It is context sensitive, so Git will apply any pulled changes to the branch you are currently working in. One thing to keep in mind is that <code>pull</code> automatically applies the changes without letting you review them first. If you don't closely manage your branches you may run into frequent conflicts.</p>
+
+ <h4>Fetch/Merge</h4>
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ git fetch upstream<span>Fetches any new changes from the original repo</span></span>
+ <span class="codeline">$ git merge upstream/master<span>Merges any changes fetched into your working files</span></span>
+ </pre>
+ <p>When you <code>fetch</code>, Git downloads any changes from the specified branch, but does not apply them to your files. This is very useful if you need to keep your repo up to date but are working on something that might break if your files are updated. To apply the changes, you use <code>merge</code>. This combines the specified branches and prompts you if there are any conflicts.</p>
+ </div>
+ </div>
+
+- <span class="step-title">Work with branches</span>
+ Branching allows you to build new features or test out ideas without putting your main project at risk. A Git branch is a small file that references the commit it was spawned from. This makes Git branches very small and easy to work with.
+
+ <div class="more-info">
+ <h4 class="compressed">How do I use branches?</h4>
+ <div class="more-content">
+
+ <p>
+ Branches are pretty easy to work with and will save you a lot of headaches, especially when working with multiple people. To create a branch and begin working in it, use the following script:
+ </p>
+
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ git branch newbranch<span>Creates a new branch called "newbranch"</span></span>
+ <span class="codeline">$ git checkout newbranch<span>Makes "newbranch" the active branch</span></span>
+ </pre>
+
+ <p>Alternatively, you can use the shortcut:</p>
+
+ <pre class="terminal bootcamp">
+ <span class="codeline">$ git checkout -b newbranch<span>Creates a new branch called "newbranch"</span></span>
+ </pre>
+
+ <p>To switch between branches, use <code>checkout</code>.</p>
+
+ </div>
+ </div>
+
+
- <span class="step-title">Pull requests</span>
If you are hoping to contribute back to the original fork, you can send the original author a [pull request](/pull-requests/).
diff --git a/_posts/2011-02-18-be-social.markdown b/_posts/2011-02-18-be-social.markdown
index fc06e97..67935fa 100644
--- a/_posts/2011-02-18-be-social.markdown
+++ b/_posts/2011-02-18-be-social.markdown
@@ -44,7 +44,7 @@ main_category: bootcamp
<img src="/images/bootcamp/bootcamp_4_follow.jpg" width="558" height="151" alt="Click &ldquo;Follow" />
- Congratulations! You are now following a friend. You will be notified about their activity on GitHub.
+ Congratulations! You are now following a friend. Their activity on GitHub will now show up on your dashboard.
##<span>Next:</span> Watch A Project
@@ -58,7 +58,7 @@ At some point you may want to stay up-to-date with a specific project. We&rsquo;
<img src="/images/bootcamp/bootcamp_4_watch.jpg" width="558" height="151" alt="Click &ldquo;Watch" />
- Congratulations! You are now watching the the Hello World project. If the Octocat updates it, you will be notified.
+ Congratulations! You are now watching the the Hello World project. If the Octocat updates it, you will see what happened in your dashboard.
##<span>Lastly:</span> Celebrate