diff options
| author | Cameron McEfee <cameron@github.com> | 2011-02-22 18:41:25 -0800 |
|---|---|---|
| committer | Cameron McEfee <cameron@github.com> | 2011-02-22 18:41:25 -0800 |
| commit | 24e997a7789019de6c0d39dfd76660557c1a78e3 (patch) | |
| tree | 2b7e0cd5a73c13a83499a9b224a7e85c0ee7bd44 /_posts | |
| parent | d61b8ac7070f5d0eb1bb27acbf472ee7d51bd42b (diff) | |
| parent | 4958b3e6d038acfbad8b974ed927f10f62f8b17c (diff) | |
Merge branch 'gh-pages'
Diffstat (limited to '_posts')
| -rw-r--r-- | _posts/2011-02-15-linux-set-up-git.markdown | 184 | ||||
| -rw-r--r-- | _posts/2011-02-15-mac-set-up-git.markdown | 173 | ||||
| -rw-r--r-- | _posts/2011-02-15-set-up-git-redirect.markdown | 19 | ||||
| -rw-r--r-- | _posts/2011-02-15-win-set-up-git.markdown | 157 | ||||
| -rw-r--r-- | _posts/2011-02-16-create-a-repo.markdown | 74 | ||||
| -rw-r--r-- | _posts/2011-02-17-fork-a-repo.markdown | 79 | ||||
| -rw-r--r-- | _posts/2011-02-18-be-social.markdown | 72 |
7 files changed, 758 insertions, 0 deletions
diff --git a/_posts/2011-02-15-linux-set-up-git.markdown b/_posts/2011-02-15-linux-set-up-git.markdown new file mode 100644 index 0000000..5f53caf --- /dev/null +++ b/_posts/2011-02-15-linux-set-up-git.markdown @@ -0,0 +1,184 @@ +--- +layout: default +title: Set Up Git (Linux) +description: A quick guide to help you get started with Git +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. This guide will walk you through setting both up, and explain a little about how everything works along the way. If you already have Git experience and just want the short version, read the <a href="http://help.github.com">technical walkthrough instead</a>.</span> + +##<span>First:</span> Download and Install Git + +At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same dudes that created Linux, Git is responsible for everything GitHub related that happens locally on your computer. + +_*If you don’t already know what Git is, <a href="http://progit.org/book/ch1-3.html" target="_blank">take a crash course.</a>_ + +1. <span class="step-title">Download and install the latest version of Git with Synaptic.</span> + + We suggest you install git-core, git-gui, and git-doc. + + <img src="/images/bootcamp/bootcamp_1_linux_install_1.jpg" width="558" height="426" alt="Open Synaptic" /> + <img src="/images/bootcamp/bootcamp_1_linux_install_2.jpg" width="558" height="480" alt="Mark git-core, git-gui, and git-doc for installation" /> + <img src="/images/bootcamp/bootcamp_1_linux_install_3.jpg" width="558" height="480" alt="git-core, git-gui, and git-doc are selected" /> + + When you’ve selected git-core, git-gui, and git-doc, hit “Apply” to install them. + + <img src="/images/bootcamp/bootcamp_1_linux_install_4.jpg" width="558" height="173" alt="Click Apply" /> + + __*Note*__ Don’t worry that you don’t see an icon when it’s done. It’s not that kind of application. + +##<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. + +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"> </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’t begin with a $ (we’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’t have any output. Don’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> + +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> + </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> +2. <span class="step-title">Backup and remove existing SSH keys.</span> + + Since there is already an SSH directory you’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> + </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. + + <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> + </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">| .+ + |</span> + <span class="terminal-output codeline">| = o O . |</span> + <span class="terminal-output codeline">| = * * |</span> + <span class="terminal-output codeline">| o = + |</span> + <span class="terminal-output codeline">| o S . |</span> + <span class="terminal-output codeline">| o o = |</span> + <span class="terminal-output codeline">| o . E |</span> + <span class="terminal-output codeline">| |</span> + <span class="terminal-output codeline">| |</span> + <span class="terminal-output codeline">+-----------------+</span> + </pre> + +4. <span class="step-title">Add your SSH key to GitHub.</span> + + On the GitHub site _Click “Account Settings”_ > _Click “SSH Public Keys”_ > _Click “Add another public key”_ + + It’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> + </pre> + + Now paste it into the “Key” field + + <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" /> + + Hit “Add Key” + +5. <span class="step-title">Test everything out.</span> + + To make sure everything is working you'll now SSH to GitHub: + + <pre class="terminal bootcamp"> + <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">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> + </pre> + + Don’t worry, this is supposed to happen. Type “yes”. + + <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> + </pre> + +##<span>Then: </span> Set Up Your Info + +Now that you have Git set up and your SSH keys entered in GitHub, it’s time to configure your personal info. + +1. <span class="step-title">Set your username and email.</span> + + Git tracks who makes each commit by checking the user’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> + </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 “Account Settings”_ > _Click “Account Admin”_ + + <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> + </pre> + + __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. + +##<span>Lastly:</span> Celebrate + +Congratulations, you now have Git and GitHub all set up! What do you want to do next? + +<ol class="next-steps"> +<li>Set Up Git</li> +<li><a href="/create-a-repo/">Create A Repository</a></li> +<li><a href="/fork-a-repo/">Fork A Repository</a></li> +<li><a href="/be-social/">Be Social</a></li> +</ol>
\ No newline at end of file diff --git a/_posts/2011-02-15-mac-set-up-git.markdown b/_posts/2011-02-15-mac-set-up-git.markdown new file mode 100644 index 0000000..a4d3ef6 --- /dev/null +++ b/_posts/2011-02-15-mac-set-up-git.markdown @@ -0,0 +1,173 @@ +--- +layout: default +title: Set Up Git (OSX) +description: A quick guide to help you get started with Git +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. This guide will walk you through setting both up, and explain a little about how everything works along the way. If you already have Git experience and just want the short version, read the <a href="http://help.github.com">technical walkthrough instead</a>.</span> + +##<span>First:</span> Download and Install Git + +At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same dudes that created Linux, Git is responsible for everything GitHub related that happens locally on your computer. + +_*If you don’t already know what Git is, <a href="http://progit.org/book/ch1-3.html" target="_blank">take a crash course.</a>_ + +1. <span class="step-title">Download and install <a href="http://git-scm.com/" target="_blank">the latest version of Git</a>.</span> + + __*Note*__ Don’t worry that you don’t see an icon when it’s done. It’s not that kind of application. + +##<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. + +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"> </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’t begin with a $ (we’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’t have any output. Don’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> + +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> + </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> +2. <span class="step-title">Backup and remove existing SSH keys.</span> + + Since there is already an SSH directory you’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> + </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. + + <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> + </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">| .+ + |</span> + <span class="terminal-output codeline">| = o O . |</span> + <span class="terminal-output codeline">| = * * |</span> + <span class="terminal-output codeline">| o = + |</span> + <span class="terminal-output codeline">| o S . |</span> + <span class="terminal-output codeline">| o o = |</span> + <span class="terminal-output codeline">| o . E |</span> + <span class="terminal-output codeline">| |</span> + <span class="terminal-output codeline">| |</span> + <span class="terminal-output codeline">+-----------------+</span> + </pre> + +4. <span class="step-title">Add your SSH key to GitHub.</span> + + On the GitHub site _Click “Account Settings”_ > _Click “SSH Public Keys”_ > _Click “Add another public key”_ + + It’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> + </pre> + + Now paste it into the “Key” field + + <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" /> + + Hit “Add Key” + +5. <span class="step-title">Test everything out.</span> + + To make sure everything is working you'll now SSH to GitHub: + + <pre class="terminal bootcamp"> + <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">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> + </pre> + + Don’t worry, this is supposed to happen. Type “yes”. + + <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> + </pre> + +##<span>Then: </span> Set Up Your Info + +Now that you have Git set up and your SSH keys entered in GitHub, it’s time to configure your personal info. + +1. <span class="step-title">Set your username and email.</span> + + Git tracks who makes each commit by checking the user’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> + </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 “Account Settings”_ > _Click “Account Admin”_ + + <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> + </pre> + + __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. + +##<span>Lastly:</span> Celebrate + +Congratulations, you now have Git and GitHub all set up! What do you want to do next? + +<ol class="next-steps"> +<li>Set Up Git</li> +<li><a href="/create-a-repo/">Create A Repository</a></li> +<li><a href="/fork-a-repo/">Fork A Repository</a></li> +<li><a href="/be-social/">Be Social</a></li> +</ol>
\ No newline at end of file diff --git a/_posts/2011-02-15-set-up-git-redirect.markdown b/_posts/2011-02-15-set-up-git-redirect.markdown new file mode 100644 index 0000000..860abc0 --- /dev/null +++ b/_posts/2011-02-15-set-up-git-redirect.markdown @@ -0,0 +1,19 @@ +--- +layout: default +title: Set Up Git +description: A quick guide to help you get started with Git +categories: bootcamp +main_category: bootcamp +--- + +Attempting to redirect to the guide for your OS. If the redirect fails, pick your OS: + +* [Windows](win-set-up-git) +* [Mac](mac-set-up-git) +* [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/'} +</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 new file mode 100644 index 0000000..bdbf163 --- /dev/null +++ b/_posts/2011-02-15-win-set-up-git.markdown @@ -0,0 +1,157 @@ +--- +layout: default +title: Set Up Git (Windows) +description: A quick guide to help you get started with Git +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. This guide will walk you through setting both up, and explain a little about how everything works along the way. If you already have Git experience and just want the short version, read the <a href="http://help.github.com">technical walkthrough instead</a>.</span> + +##<span>First:</span> Download and Install Git + +At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same dudes that created Linux, Git is responsible for everything GitHub related that happens locally on your computer. + +_*If you don’t already know what Git is, <a href="http://progit.org/book/ch1-3.html" target="_blank">take a crash course.</a>_ + +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. + +##<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. + +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"> </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’t begin with a $ (we’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’t have any output. Don’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> +</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> + </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> +2. <span class="step-title">Backup and remove existing SSH keys.</span> + + Since there is already an SSH directory you’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> + </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. + + <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> + </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> + </pre> + +4. <span class="step-title">Add your SSH key to GitHub.</span> + + On the GitHub site _Click “Account Settings”_ > _Click “SSH Public Keys”_ > _Click “Add another public key”_ + + First, open the id_rsa.pub file with a text editor (Notepad will do just fine). This is your SSH key. It’s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. Now paste it into the “Key” field + + <img src="/images/bootcamp/bootcamp_1_ssh.jpg" width="558" height="373" alt="Paste your SSH Key" /> + + Hit “Add Key” + +5. <span class="step-title">Test everything out.</span> + + To make sure everything is working you'll now SSH to GitHub: + + <pre class="terminal bootcamp"> + <span class="codeline">$ ssh git@github.com<span class="terminal-tooltip">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> + </pre> + + Don’t worry, this is supposed to happen. Type “yes”. + + <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> + </pre> + +##<span>Then: </span> Set Up Your Info + +Now that you have Git set up and your SSH keys entered in GitHub, it’s time to configure your personal info. + +1. <span class="step-title">Set your username and email.</span> + + Git tracks who makes each commit by checking the user’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> + </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 “Account Settings”_ > _Click “Account Admin”_ + + <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> + </pre> + + __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. + +##<span>Lastly:</span> Celebrate + +Congratulations, you now have Git and GitHub all set up! What do you want to do next? + +<ol class="next-steps"> +<li>Set Up Git</li> +<li><a href="/create-a-repo/">Create A Repository</a></li> +<li><a href="/fork-a-repo/">Fork A Repository</a></li> +<li><a href="/be-social/">Be Social</a></li> +</ol> +<script> + $('#os').html("<b>" + $.client.os + "</b>"); +</script>
\ No newline at end of file diff --git a/_posts/2011-02-16-create-a-repo.markdown b/_posts/2011-02-16-create-a-repo.markdown new file mode 100644 index 0000000..3cd470a --- /dev/null +++ b/_posts/2011-02-16-create-a-repo.markdown @@ -0,0 +1,74 @@ +--- +layout: default +title: Create A Repo +description: Create the place where your commits will be stored +categories: bootcamp +main_category: bootcamp +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. This guide will walk you through creating your first repo, creating a README file, and making your first commit.</span> + +##<span>First:</span> Create A Repo + +Every time you push your commits to GitHub, they get stored in a repository (a.k.a. “repo”) + +1. <span class="step-title">Create a new repo</span> + + Click “New Repository + + <img src="/images/bootcamp/bootcamp_2_newrepo.jpg" width="558" height="291" alt="Click “New Repository" /> + + Fill out the information on this page. When you’re done, click “Create Repository” + + <img src="/images/bootcamp/bootcamp_2_repoinfo.jpg" width="558" height="437" alt="Fill in the info" /> + + Congratulations! You have successfully created your first repo! + +##<span>Next:</span> Create a README for your repo. + +While a README isn’t a required part of a GitHub repo, it is a good idea to have one. READMEs are a great place to describe your project or add some documentation such as how to install or use your project. + +1. <span class="step-title">Create the README file</span> + + 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> + </pre> + + Open the new README file found in your Hello-World folder in a text editor and add the text “Hello World!.” When you are finished, save and close the file. + +2. <span class="step-title">Commit your README</span> + + 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> + </pre> + + The code above executes actions locally, meaning you still haven’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> + </pre> + + Now if you look at your repository on GitHub, you will see your README has been added to it. + + <img src="/images/bootcamp/bootcamp_2_updatedreadme.jpg" width="558" height="577" alt="Your README has been created" /> + +##<span>Lastly:</span> Celebrate + +Congratulations! You have now created a repository on GitHub, created a README, committed it, and pushed it to GitHub. What do you want to do next? + +<ol class="next-steps"> +<li><a href="/set-up-git-redirect/">Set Up Git</a></li> +<li>Create A Repository</li> +<li><a href="/fork-a-repo/">Fork A Repository</a></li> +<li><a href="/be-social/">Be Social</a></li> +</ol>
\ No newline at end of file diff --git a/_posts/2011-02-17-fork-a-repo.markdown b/_posts/2011-02-17-fork-a-repo.markdown new file mode 100644 index 0000000..4e8878c --- /dev/null +++ b/_posts/2011-02-17-fork-a-repo.markdown @@ -0,0 +1,79 @@ +--- +layout: default +title: Fork A Repo +description: Copy a repo to create a new, unique project from its contents. +categories: bootcamp +main_category: bootcamp +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. At some point you may want use another user’s project as the starting point for your own. This is known as "forking."</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. + +1. <span class="step-title">Fork the “Fork It ” repo</span> + + To fork this project, click the "Fork" button. + + <img src="/images/bootcamp/bootcamp_3_fork.jpg" width="558" height="137" alt="Click “Fork" /> + +##Next: Set Up Your Local Repo + +You’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. + +1. <span class="step-title">Clone the “Fork It ” 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> + </pre> + +2. <span class="step-title">Configure remotes</span> + + Each repository has a default remote* 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`: + + <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> + </pre> + + *A “remote” is a reference to the GitHub URL where your commits are stored. + +##<span>Then:</span> More Things You Can Do + +Congratulations, you’ve successfully forked a repo, but get a load of these other cool things you can do: + +- <span class="step-title">Push commits</span> + + Once you’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> + </pre> + +- <span class="step-title">Pull in upstream changes</span> + + 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> + </pre> + +- <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/). + +##<span>Lastly:</span> Celebrate + +You have now created forked a repo. What do you want to do next? + +<ol class="next-steps"> +<li><a href="/set-up-git-redirect/">Set Up Git</a></li> +<li><a href="/create-a-repo/">Create A Repository</a></li> +<li>Fork A Repository</li> +<li><a href="/be-social/">Be Social</a></li> +</ol>
\ No newline at end of file diff --git a/_posts/2011-02-18-be-social.markdown b/_posts/2011-02-18-be-social.markdown new file mode 100644 index 0000000..fc06e97 --- /dev/null +++ b/_posts/2011-02-18-be-social.markdown @@ -0,0 +1,72 @@ +--- +layout: default +title: Be Social +description: Follow a friend. Watch a project. +categories: bootcamp +main_category: bootcamp +--- + +<span class="intro">If you’ve found yourself on this page, we’re assuming you’re brand new to Git and GitHub. Being social is one of the key features of GitHub. Open source projects become even more awesome when people come together to collaborate and we are happy to help that happen!</span> + +##<span>First:</span> Follow A Friend + +1. <span class="step-title">Pick a friend.</span> + + Why not follow one of these cool people? + <div class="founders"> + <a href="https://github.com/mojombo" class="founder" target="_blank"> + <img src="https://secure.gravatar.com/avatar/25c7c18223fb42a4c6ae1c8db6f50f9b" width="50" height="50"/> + <h4>Tom Preston-Werner</h4> + <p>mojombo</p> + </a> + <a href="https://github.com/defunkt" class="founder" target="_blank"> + <img src="https://secure.gravatar.com/avatar/b8dbb1987e8e5318584865f880036796" width="50" height="50"/> + <h4>Chris Wanstrath</h4> + <p>defunkt</p> + </a> + <a href="https://github.com/pjhyett" class="founder" target="_blank"> + <img src="https://secure.gravatar.com/avatar/290cf664d9e6f823fc3af57556493db7" width="50" height="50"/> + <h4>PJ Hyett</h4> + <p>pjhyett</p> + </a> + <a href="https://github.com/schacon" class="founder" target="_blank"> + <img src="https://secure.gravatar.com/avatar/9375a9529679f1b42b567a640d775e7d" width="50" height="50"/> + <h4>Scott Chacon</h4> + <p>schacon</p> + </a> + </div> + + Who are these fine fellows? Why the founders of GitHub, of course! + +2. <span class="step-title">Follow a friend</span> + + Once you are on one of their pages, click the “follow” button. + + <img src="/images/bootcamp/bootcamp_4_follow.jpg" width="558" height="151" alt="Click “Follow" /> + + Congratulations! You are now following a friend. You will be notified about their activity on GitHub. + +##<span>Next:</span> Watch A Project + +At some point you may want to stay up-to-date with a specific project. We’ve made this easy to do. + +1. <span class="step-title">Watch a project</span> + + Our friend the Octocat has a project called <a href="https://github.com/octocat/Hello-World" target="_blank">Hello World</a> that we’d like to watch. + + Once you are in the project page, you will notice there is a “watch” button at the top of the page. Click on it. + + <img src="/images/bootcamp/bootcamp_4_watch.jpg" width="558" height="151" alt="Click “Watch" /> + + Congratulations! You are now watching the the Hello World project. If the Octocat updates it, you will be notified. + +##<span>Lastly:</span> Celebrate + +Congratulations! You are quite the socialite. What do you want to do next? + +<ol class="next-steps"> +<li><a href="/set-up-git-redirect/">Set Up Git</a></li> +<li><a href="/create-a-repo/">Create A Repository</a></li> +<li><a href="/fork-a-repo/">Fork A Repository</a></li> +<li>Be Social</li> +</ol>
\ No newline at end of file |
