diff options
Diffstat (limited to '_posts')
24 files changed, 201 insertions, 745 deletions
diff --git a/_posts/2008-02-15-set-up-git-redirect.markdown b/_posts/2008-02-15-set-up-git-redirect.markdown index 932ef99..c8d5858 100644 --- a/_posts/2008-02-15-set-up-git-redirect.markdown +++ b/_posts/2008-02-15-set-up-git-redirect.markdown @@ -1,18 +1,9 @@ --- -layout: default +layout: os_redirect title: Set Up Git description: A quick guide to help you get started with Git categories: bootcamp +redirect_win: /win-set-up-git +redirect_mac: /mac-set-up-git +redirect_linux: /linux-set-up-git --- - -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 = '/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/2009-06-11-forking.markdown b/_posts/2009-06-11-forking.markdown index bb06e35..aaf8b5b 100755 --- a/_posts/2009-06-11-forking.markdown +++ b/_posts/2009-06-11-forking.markdown @@ -1,11 +1,6 @@ --- -layout: default +layout: redirect title: Forking a project description: How to fork a project, submit changes, and pull from other repos in the fork network +redirect_to: /fork-a-repo --- - -This page has moved. If the redirect fails, [click me](fork-a-repo) - -<script type="text/javascript"> - window.location = '/fork-a-repo' -</script> diff --git a/_posts/2009-06-13-fork-a-repo.markdown b/_posts/2009-06-13-fork-a-repo.markdown index 439f838..a641b4e 100644 --- a/_posts/2009-06-13-fork-a-repo.markdown +++ b/_posts/2009-06-13-fork-a-repo.markdown @@ -31,7 +31,7 @@ You’ve successfully forked the Spoon-Knife repo, but so far it only exists 2. <span class="step-title">Configure remotes</span> - When clone a repo, it has a default remote called `origin` that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named `upstream`: + When a repo is cloned, it has a default remote called `origin` that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named `upstream`: <div class="more-info"> <h4 class="compressed">More about remotes</h4> diff --git a/_posts/2009-06-13-git-installation-redirect.markdown b/_posts/2009-06-13-git-installation-redirect.markdown index 3040d7f..7dfa9b8 100644 --- a/_posts/2009-06-13-git-installation-redirect.markdown +++ b/_posts/2009-06-13-git-installation-redirect.markdown @@ -1,17 +1,8 @@ --- -layout: default +layout: os_redirect title: Installing git description: How to install git +redirect_win: /win-set-up-git +redirect_mac: /mac-set-up-git +redirect_linux: /linux-set-up-git --- - -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 = '/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> diff --git a/_posts/2009-06-13-linux-set-up-git.markdown b/_posts/2009-06-13-linux-set-up-git.markdown index 1564fd9..3e82e95 100644 --- a/_posts/2009-06-13-linux-set-up-git.markdown +++ b/_posts/2009-06-13-linux-set-up-git.markdown @@ -16,21 +16,21 @@ _*If you don’t already know what Git is, <a href="http://progit.org/bo 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" /> - + If you don’t have a package manager like Synaptic, or you’d rather install the necessary git components from the command line, you can alternatively run the script below: - + <pre class="terminal bootcamp"> <span class="codeline">$ sudo apt-get install git-core git-gui git-doc<span>Installs git-core, git-gui, and git-doc on your system</span></span> </pre> - + __*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 @@ -45,182 +45,41 @@ To make sure you generate a brand new key, you need to check if one already exis <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 for an explanation of 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 quotation marks.</span></span> </pre> - + <p>Areas of yellow text represent your own personal info, repos, etc. 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 Terminal don’t have any output. Don’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> </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>Checks to see if there is a directory named ".ssh" in your user directory</span></span> - </pre> - - If it says “No such file or directory“ 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’ll want to back the old one up and remove it: - - <pre class="terminal bootcamp"> - <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 subdirectory 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 directory into key_backup directory</span></span> - <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa directory</span></span> - </pre> - -3. <span class="step-title">Generate a new SSH key.</span> - - 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 (/home/<em>your_user_directory</em>/.ssh/id_rsa):</span> - </pre> - - Now you need to enter a passphrase. - - <div class="more-info"> - <h4 class="compressed">Why do passphrases matter?</h4> - <div class="more-content"> - <p>Passwords aren’t very secure, you already know this. If you use one that’s easy to remember, it’s easier to guess or brute-force (try many options until one works). If you use one that’s random it’s hard to remember, and thus you’re more inclined to write the password down. Both of these are Very Bad Things™. This is why you’re using ssh keys.</p> - - <p>But using a key without a passphrase is basically the same as writing down that random password in a file on your computer. Anyone who gains access to your drive has gained access to every system you use that key with. This is also a Very Bad Thing™. The solution is obvious: add a passphrase.</p> - - <p><em>But I don’t want to enter a long passphrase every time I use the key!</em></p> - - <p>Neither do we! Thankfully, there’s a nifty little tool called <code>ssh-agent</code> that can save your passphrase securely so you don’t have to re-enter it. Most linux installations will automatically start <code>ssh-agent</code> for you when you log in.</p> - - <p>For more information about SSH key passphrases, check out our <a href="/working-with-key-passphrases">help guide</a>.</p> - </div> - </div> - - <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="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">| .+ + |</span> - <span class="bash-output">| = o O . |</span> - <span class="bash-output">| = * * |</span> - <span class="bash-output">| o = + |</span> - <span class="bash-output">| o S . |</span> - <span class="bash-output">| o o = |</span> - <span class="bash-output">| o . E |</span> - <span class="bash-output">| |</span> - <span class="bash-output">| |</span> - <span class="bash-output">+-----------------+</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>Downloads and installs xclip</span></span> - <span class="codeline">$ xclip -sel clip < ~/.ssh/id_rsa.pub<span>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="402" 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. Don’t change the “git@github.com” part. That’s supposed to be there. - - <pre class="terminal bootcamp"> - <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="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’t worry, this is supposed to happen. Type “yes”. - - <pre class="terminal bootcamp"> - <span class="bash-output">PTY allocation request failed on channel 0</span> - <span class="bash-output">Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide shell access.</span> - <span class="bash-output">Connection to github.com closed.</span> - - </pre> - - Don’t worry, about the “failed” part. All you should care about is that you see “You’ve successfully authenticated” +{% include ssh_setup.markdown %} ##<span>Then: </span> Set Up Your Info -Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. - -1. <span class="step-title">Set your username and email.</span> +Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. - 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 "<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 “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 <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> - - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##<span>Lastly:</span> Celebrate diff --git a/_posts/2009-06-13-mac-set-up-git.markdown b/_posts/2009-06-13-mac-set-up-git.markdown index fa66b2d..527d63f 100644 --- a/_posts/2009-06-13-mac-set-up-git.markdown +++ b/_posts/2009-06-13-mac-set-up-git.markdown @@ -29,200 +29,41 @@ To make sure you generate a brand new key, you need to check if one already exis <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 your Mac 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 for an explanation of 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 quotation marks.</span></span> </pre> - + <p>Areas of yellow text represent your own personal info, repos, etc. If it is part of an input ($) line, you should replace 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 Terminal don’t have any output. Don’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> </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>Checks to see if there is a directory named ".ssh" in your user directory</span></span> - </pre> - - If it says “No such file or directory“ 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’ll want to back the old one up and remove it: - - <pre class="terminal bootcamp"> - <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 subdirectory 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 directory into key_backup </span></span> - <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa directory</span></span> - </pre> - -3. <span class="step-title">Generate a new SSH key.</span> - - 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. - - <div class="more-info"> - <h4 class="compressed">Why do passphrases matter?</h4> - <div class="more-content"> - <p>Passwords aren’t very secure, you already know this. If you use one that’s easy to remember, it’s easier to guess or brute-force (try many options until one works). If you use one that’s random it’s hard to remember, and thus you’re more inclined to write the password down. Both of these are Very Bad Things™. This is why you’re using ssh keys.</p> - - <p>But using a key without a passphrase is basically the same as writing down that random password in a file on your computer. Anyone who gains access to your drive has gained access to every system you use that key with. This is also a Very Bad Thing™. The solution is obvious: add a passphrase.</p> - - <p><em>But I don’t want to enter a long passphrase every time I use the key!</em></p> - - <p>Neither do we! Thankfully, there’s a nifty little tool called <code>ssh-agent</code> that can save your passphrase securely so you don’t have to re-enter it. If you’re on OSX Leopard or later your keys can be saved in the system’s keychain to make your life even easier.</p> - - <p>For more information about SSH key passphrases, check out our <a href="/working-with-key-passphrases">help guide</a>.</p> - </div> - </div> - - - <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="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">| .+ + |</span> - <span class="bash-output">| = o O . |</span> - <span class="bash-output">| = * * |</span> - <span class="bash-output">| o = + |</span> - <span class="bash-output">| o S . |</span> - <span class="bash-output">| o o = |</span> - <span class="bash-output">| o . E |</span> - <span class="bash-output">| |</span> - <span class="bash-output">| |</span> - <span class="bash-output">+-----------------+</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">$ pbcopy < ~/.ssh/id_rsa.pub<span>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="402" 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. Don’t change the “git@github.com” part. That’s supposed to be there. - - <pre class="terminal bootcamp"> - <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="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’t worry, this is supposed to happen. Type “yes”. - - <pre class="terminal bootcamp"> - <span class="bash-output">PTY allocation request failed on channel 0</span> - <span class="bash-output">Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide shell access.</span> - <span class="bash-output">Connection to github.com closed.</span> - - </pre> - - Don’t worry, about the “failed” part. All you should care about is that you see “You’ve successfully authenticated” - +{% include ssh_setup.markdown %} ##<span>Then: </span> Set Up Your Info -Now that you have Git set up and your SSH keys entered into 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 "<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> - - <div class="more-info"> - <h4 class="compressed">More about user info</h4> - <div class="more-content"> - <p> - The steps listed above show you how to set your user info globally. This means that no matter which repo you work in on your computer, you’ll be making commits as that user. If you find yourself needing to make commits with different user info for a specific repo (perhaps for work vs. personal projects), you will have to change the info in that repo itself. - </p> - <pre class="terminal bootcamp"> - <span class="codeline">$ cd <em>my_other_repo</em><span>Changes the working directory to the repo you need to switch info for</span></span> - <span class="codeline">$ git config user.name "<em>Different Name</em>"<span>Sets the user's name for this specific repo</span></span> - <span class="codeline">$ git config user.email "<em>differentemail@email.com</em>"<span>Sets the user's email for this specific repo</span></span> - </pre> - <p> - Now your commits will be “blamed” on (associated with) new user name and email whenever working in the specified repo. - </p> - </div> - </div> - -2. <span class="step-title">Set your GitHub token.</span> +Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. - 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 <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> - - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##<span>Lastly:</span> Celebrate diff --git a/_posts/2009-06-13-win-set-up-git.markdown b/_posts/2009-06-13-win-set-up-git.markdown index d3f2e4f..c9d218c 100644 --- a/_posts/2009-06-13-win-set-up-git.markdown +++ b/_posts/2009-06-13-win-set-up-git.markdown @@ -14,9 +14,9 @@ At the heart of GitHub is an open source version control system (VCS) called Git _*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. - + <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" /> @@ -27,7 +27,7 @@ _*If you don’t already know what Git is, <a href="http://progit.org/bo <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 @@ -42,161 +42,41 @@ To make sure you generate a brand new key, you need to check if one already exis <h4 class="compressed">Need a quick lesson about Git Bash?</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 was installed with Git called Git Bash.</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 for an explanation of 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 quotation marks.</span></span> </pre> - + <p>Areas of yellow text represent your own personal info, repos, etc. If it is part of an input ($) line, you should replace 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 Git Bash.</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 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.</p> - + <p><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.</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>Checks to see if there is a directory named ".ssh" in your user directory</span></span> - </pre> - - If it says “No such file or directory“ 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’ll want to back the old one up and remove it: - - <pre class="terminal bootcamp"> - <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 subdirectory 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 directory into key_backup directory</span></span> - <span class="codeline">$ rm id_rsa*<span>Deletes the contents of the id_rsa directory</span></span> - </pre> - -3. <span class="step-title">Generate a new SSH key.</span> - - 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. - - <div class="more-info"> - <h4 class="compressed">Why do passphrases matter?</h4> - <div class="more-content"> - <p>Passwords aren’t very secure, you already know this. If you use one that’s easy to remember, it’s easier to guess or brute-force (try many options until one works). If you use one that’s random it’s hard to remember, and thus you’re more inclined to write the password down. Both of these are Very Bad Things™. This is why you’re using ssh keys.</p> - - <p>But using a key without a passphrase is basically the same as writing down that random password in a file on your computer. Anyone who gains access to your drive has gained access to every system you use that key with. This is also a Very Bad Thing™. The solution is obvious: add a passphrase.</p> - - <p><em>But I don’t want to enter a long passphrase every time I use the key!</em></p> - - <p>Neither do we! Thankfully, there’s a nifty little tool called <code>ssh-agent</code> that can save your passphrase securely so you don’t have to re-enter it. Unfortunately, it takes a little work to get it up and running on Windows. For more information check out our <a href="/working-with-key-passphrases">help guide</a>.</p> - </div> - </div> - - <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="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 “Account Settings”_ > _Click “SSH Public Keys”_ > _Click “Add another public key”_ - - 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="402" 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. Don’t change the “git@github.com” part. That’s supposed to be there. - - <pre class="terminal bootcamp"> - <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="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’t worry, this is supposed to happen. Type “yes”. - - <pre class="terminal bootcamp"> - <span class="bash-output">PTY allocation request failed on channel 0</span> - <span class="bash-output">Hi <em>username</em>! You've successfully authenticated, but GitHub does not provide shell access.</span> - <span class="bash-output">Connection to github.com closed.</span> - - </pre> - - Don’t worry, about the “failed” part. All you should care about is that you see “You’ve successfully authenticated” +{% include ssh_setup.markdown %} ##<span>Then: </span> Set Up Your Info -Now that you have Git set up and your SSH keys entered into 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 "<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> +Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info. - 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 <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> - - __*Note*__ If you ever change your GitHub password, a new token will be created and will need to be updated. +{% include email_setup.markdown %} ##<span>Lastly:</span> Celebrate @@ -209,5 +89,5 @@ Congratulations, you now have Git and GitHub all set up! What do you want to do <li><a href="/be-social/">Be Social</a></li> </ol> <script> - $('#os').html("<b>" + $.client.os + "</b>"); + $('#os').html("<b>" + $.client.os + "</b>"); </script>
\ No newline at end of file diff --git a/_posts/2009-06-14-linux-git-installation.markdown b/_posts/2009-06-14-linux-git-installation.markdown index 97f5af4..71e2316 100644 --- a/_posts/2009-06-14-linux-git-installation.markdown +++ b/_posts/2009-06-14-linux-git-installation.markdown @@ -1,11 +1,6 @@ --- -layout: default +layout: redirect title: Installing git (Linux) description: How to install git on Linux +redirect_to: /linux-set-up-git --- - -This page has moved. If the redirect fails, [click me](linux-set-up-git) - -<script type="text/javascript"> - window.location = '/linux-set-up-git' -</script> diff --git a/_posts/2009-06-14-mac-git-installation.markdown b/_posts/2009-06-14-mac-git-installation.markdown index a63a7c8..4c0bd7f 100644 --- a/_posts/2009-06-14-mac-git-installation.markdown +++ b/_posts/2009-06-14-mac-git-installation.markdown @@ -1,11 +1,6 @@ --- -layout: default +layout: redirect title: Installing git (OSX) description: How to install git on OSX +redirect_to: /mac-set-up-git --- - -This page has moved. If the redirect fails, [click me](mac-set-up-git) - -<script type="text/javascript"> - window.location = '/mac-set-up-git' -</script> diff --git a/_posts/2009-06-14-win-git-installation.markdown b/_posts/2009-06-14-win-git-installation.markdown index 4e618f4..dd0571d 100644 --- a/_posts/2009-06-14-win-git-installation.markdown +++ b/_posts/2009-06-14-win-git-installation.markdown @@ -1,11 +1,6 @@ --- -layout: default +layout: redirect title: Installing git (Win/msysgit) description: How to install git on Windows +redirect_to: /win-set-up-git --- - -This page has moved. If the redirect fails, [click me](win-set-up-git) - -<script type="text/javascript"> - window.location = '/win-set-up-git' -</script> diff --git a/_posts/2009-06-15-key-setup-redirect.markdown b/_posts/2009-06-15-key-setup-redirect.markdown index 45e7327..e20e091 100644 --- a/_posts/2009-06-15-key-setup-redirect.markdown +++ b/_posts/2009-06-15-key-setup-redirect.markdown @@ -1,18 +1,8 @@ --- -layout: default +layout: os_redirect title: Generating SSH keys description: How to generate SSH keys and add them to GitHub +redirect_win: /win-set-up-git +redirect_mac: /mac-set-up-git +redirect_linux: /linux-set-up-git --- - -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 = '/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/2009-06-15-linux-key-setup.markdown b/_posts/2009-06-15-linux-key-setup.markdown index 2093e10..8dfa42d 100644 --- a/_posts/2009-06-15-linux-key-setup.markdown +++ b/_posts/2009-06-15-linux-key-setup.markdown @@ -1,77 +1,6 @@ --- -layout: default +layout: redirect title: Generating SSH keys (Linux) description: Setting up SSH keys on Linux -categories: linux +redirect_to: /linux-set-up-git --- - -This guide will step you through the process of generating a keypair on linux and uploading it to GitHub. We use Ubuntu and bash in this guide, command may vary depending on your linux flavor and shell. - -Generating an SSH key on linux is a fairly straightforward process. First and foremost, open up a "terminal":https://help.ubuntu.com/community/UsingTheTerminal. - -h2. Backup and remove existing keys - -p(. _If you have an existing keypair you wish to use, you can skip this step._ - -Unless this is your first time setting up ssh or git on your computer, you should double check that keys do not already exist. If they do you can either use the existing key(s) or remove them. In either case, you should make a backup of the keys. - -First check to see if a ssh key directory exists. - -<pre class="terminal">$ cd ~/.ssh</pre> - -If you get a "No such file or directory" error, you can skip to "Generating a key". - -<pre class="terminal">$ ls -config id_rsa.pub -id_rsa known_hosts -$ mkdir key_backup -$ cp id_rsa* key_backup -$ rm id_rsa*</pre> - -Here we have an existing keypair, @id_rsa@ and @id_rsa.pub@, which we've copied into @~/.ssh/key_backup@ before removing. By default, ssh will use keys in @~/.ssh@ that are named @id_rsa@, @id_dsa@ or @identity@. - -h2. Generating a key - -p(. _If you have an existing keypair you wish to use, you can skip this step._ - -Now that we're certain ssh won't use an existing key, it's time to generate a new keypair. Lets make an RSA keypair: - -<pre class="terminal">$ ssh-keygen -t rsa -C "tekkub@gmail.com" -Generating public/private rsa key pair. -Enter file in which to save the key (/home/tekkub/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /home/tekkub/.ssh/id_rsa. -Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub. -The key fingerprint is: -01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db tekkub@gmail.com</pre> - -At the first prompt you can just hit enter to generate the key with the default name. *You should use a good passphrase with your key.* See "Working with SSH key passphrases":/working-with-key-passphrases for more details on why you should use a passphrase and how to avoid re-entering it every time you use your key. - -p(. *Note:* If you don't use the default key names, or store your keys in a different path, you may need to run @ssh-add path/to/my_key@ so that ssh knows where to find your key. - -h2. Adding the key to your GitHub account - -Now launch your browser and open the "account page":https://github.com/account. In the "SSH Public Keys" section click "add another public key", then paste your public key into the "key" field. If you leave the title blank the key comment (your email) will be used for the title. - -Make sure you use the public key (@id_rsa.pub@ in our example), and do not add any newlines or whitespace inside the key. To ensure you copy the key correctly, you can copy the key directly into the clipboard from the terminal using "xclip":http://www.cyberciti.biz/faq/xclip-linux-insert-files-command-output-intoclipboard/: - -<pre class="terminal">$ sudo apt-get install xclip -$ cat ~/.ssh/id_rsa.pub | xclip -sel clip</pre> - -!/images/add_key.png! - -h2. Testing things out - -Testing if our new key works is simple, we just ssh to github. If this is the first time you're connecting you'll have to save the server's key. You can confirm the fingerprint on the SSH keys tab of the "account settings page":https://github.com/account - -<pre class="terminal">$ ssh git@github.com -The authenticity of host 'github.com (207.97.227.239)' can't be established. -RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. -Are you sure you want to continue connecting (yes/no)? yes -Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. -ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access -Connection to github.com closed. -</pre> - -If you do not get the "successfully authenticated" message, check out the "troubleshooting guide":http://github.com/guides/addressing-authentication-problems-with-ssh. diff --git a/_posts/2009-06-15-mac-key-setup.markdown b/_posts/2009-06-15-mac-key-setup.markdown index 9449be5..e080310 100644 --- a/_posts/2009-06-15-mac-key-setup.markdown +++ b/_posts/2009-06-15-mac-key-setup.markdown @@ -1,85 +1,6 @@ --- -layout: default +layout: redirect title: Generating SSH keys (OSX) description: Setting up SSH keys on Mac OSX -categories: mac +redirect_to: /mac-set-up-git --- - -This guide will step you through the process of generating a keypair on Mac OSX and uploading it to GitHub - -Generating an SSH key on OSX is a fairly straightforward process. First and foremost, open up Terminal.app. You can usually find it at @/Applications/Utilities@. - -h2. Backup and remove existing keys - -p(. _If you have an existing keypair you wish to use, you can skip this step._ - -Unless this is your first time setting up ssh or git on your computer, you should double check that keys do not already exist. If they do you can either use the existing key(s) or remove them. In either case, you should make a backup of the keys. - -First check to see if a ssh key directory exists. - -<pre class="terminal">$ cd ~/.ssh</pre> - -If you get a "No such file or directory" error, you can skip to "Generating a key". - -<pre class="terminal">$ ls -config id_rsa id_rsa.pub known_hosts -$ mkdir key_backup -$ cp id_rsa* key_backup -$ rm id_rsa*</pre> - -Here we have an existing keypair, @id_rsa@ and @id_rsa.pub@, which we've copied into @~/.ssh/key_backup@ before removing. By default, ssh will use keys in @~/.ssh@ that are named @id_rsa@, @id_dsa@ or @identity@. - -h2. Generating a key - -p(. _If you have an existing keypair you wish to use, you can skip this step._ - -Now that we're certain ssh won't use an existing key, it's time to generate a new keypair. Lets make an RSA keypair: - -<pre class="terminal">$ ssh-keygen -t rsa -C "tekkub@gmail.com" -Generating public/private rsa key pair. -Enter file in which to save the key (/Users/tekkub/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /Users/tekkub/.ssh/id_rsa. -Your public key has been saved in /Users/tekkub/.ssh/id_rsa.pub. -The key fingerprint is: -01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db tekkub@gmail.com -The key's randomart image is: -+--[ RSA 2048]----+ -| .+ + | -| = o O . | -| = * * | -| o = + | -| o S . | -| o o = | -| o . E | -| | -| | -+-----------------+</pre> - -At the first prompt you can just hit enter to generate the key with the default name. *You should use a good passphrase with your key.* See "Working with SSH key passphrases":/working-with-key-passphrases for more details on why you should use a passphrase and how to avoid re-entering it every time you use your key. - -p(. *Note:* If you don't use the default key names, or store your keys in a different path, you will need to run @ssh-add path/to/my_key@ so that ssh knows where to find your key. - -h2. Adding the key to your GitHub account - -Now launch your browser and open the "account page":https://github.com/account. In the "SSH Public Keys" section click "add another public key", then paste your public key into the "key" field. If you leave the title blank the key comment (your email) will be used for the title. - -Make sure you use the public key (@id_rsa.pub@ in our example), and do not add any newlines or whitespace inside the key. To ensure you copy the key correctly, you can copy the key directly into the clipboard from Terminal.app: <pre class="terminal">$ cat ~/.ssh/id_rsa.pub | pbcopy</pre> - -!/images/add_key.png! - -h2. Testing things out - -Testing if our new key works is simple, we just ssh to github. If this is the first time you're connecting you'll have to save the server's key. You can confirm the fingerprint on the SSH keys tab of the "account settings page":https://github.com/account - -<pre class="terminal">$ ssh git@github.com -The authenticity of host 'github.com (207.97.227.239)' can't be established. -RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. -Are you sure you want to continue connecting (yes/no)? yes -Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. -ERROR: Hi tekkub! You've successfully authenticated, but GitHub does not provide shell access -Connection to github.com closed. -</pre> - -If you do not get the "successfully authenticated" message, check out the "troubleshooting guide":http://github.com/guides/addressing-authentication-problems-with-ssh. diff --git a/_posts/2009-06-15-msysgit-key-setup.markdown b/_posts/2009-06-15-msysgit-key-setup.markdown index 70f340f..11c9da7 100644 --- a/_posts/2009-06-15-msysgit-key-setup.markdown +++ b/_posts/2009-06-15-msysgit-key-setup.markdown @@ -1,11 +1,6 @@ --- -layout: default +layout: redirect title: Generating SSH keys (Win/msysgit) description: Setting up SSH keys with msysgit on Windows +redirect_to: /win-set-up-git --- - -This page has moved. If the redirect fails, [click me](win-set-up-git) - -<script type="text/javascript"> - window.location = '/win-set-up-git' -</script> diff --git a/_posts/2009-06-20-git-email-settings.markdown b/_posts/2009-06-20-git-email-settings.markdown new file mode 100644 index 0000000..462fd5f --- /dev/null +++ b/_posts/2009-06-20-git-email-settings.markdown @@ -0,0 +1,12 @@ +--- +layout: default +title: Setting user name, email and GitHub token +description: Configure your local git installation so that commits are linked to your GitHub account +categories: troubleshooting popular +--- + +This guide covers basic git settings you should set before making any commits. + +Please note that config changes will only affect future commits. Existing commits will retain the info they were committed with. Also, the environment variables `GIT_COMMITTER_NAME`, `GIT_COMMITTER_EMAIL`, `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` will override git-config settings if they are defined. + +{% include email_setup.markdown %} diff --git a/_posts/2009-06-20-git-email-settings.textile b/_posts/2009-06-20-git-email-settings.textile deleted file mode 100644 index 105f7c4..0000000 --- a/_posts/2009-06-20-git-email-settings.textile +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: default -title: Setting user name, email and GitHub token -description: Configure your local git installation so that commits are linked to your GitHub account -categories: troubleshooting popular ---- - -This guide covers basic git settings you should set before making any commits. - -Please note that config changes will only affect future commits. Existing commits will retain the info they were committed with. Also, the environment variables @GIT_COMMITTER_NAME@, @GIT_COMMITTER_EMAIL@, @GIT_AUTHOR_NAME@ and @GIT_AUTHOR_EMAIL@ will override git-config settings if they are defined. - -h2. Setting user name and email globally in git - -Git needs to know your username and email address to properly credit your commits. Setting this setting will also let GitHub link the commits you make to your GitHub account. Only commits made after you change this setting will use the new info, old commits will preserve the info they were committed with. - -p(. _The "email" setting does not have to be a valid email address, it only need match the "user@server" naming scheme._ - -<pre class="terminal">$ git config --global user.name "Tekkub" -$ git config --global user.email "tekkub@gmail.com"</pre> - -h2. Overriding settings for individual repos - -If you do not want commits to be "blamed" on your global email setting, you can override these settings on a per-repo basis. - -<pre class="terminal">$ cd my_other_repo -$ git config user.name "Not Tekkub" -$ git config user.email "not@tekkub.net"</pre> - -h2. GitHub token config - -Some tools connect to GitHub without SSH, for these tools you need to set your "local GitHub config":http://github.com/blog/180-local-github-config. You can find your token on the "account page":https://github.com/account - -!http://img.skitch.com/20091209-k5x2xa1rrc889deqmp53464m8n.png! - -<pre class="terminal">$ git config --global github.user tekkub -$ git config --global github.token 0123456789abcdef0123456789abcdef</pre> - -If you change your GitHub password a new token will be created, therefore you'll need to change this setting. diff --git a/_posts/2009-06-25-deleting-a-repo.markdown b/_posts/2009-06-25-deleting-a-repo.markdown index 8cadcb0..2fece16 100644 --- a/_posts/2009-06-25-deleting-a-repo.markdown +++ b/_posts/2009-06-25-deleting-a-repo.markdown @@ -13,4 +13,6 @@ Go to the repository homepage → Admin: At the bottom of the page there is a button to delete the repo: -
\ No newline at end of file + + +Collaborators can not delete repos, but they can [leave them](/leave-a-repo). diff --git a/_posts/2009-06-25-moving-a-repo.markdown b/_posts/2009-06-25-moving-a-repo.markdown index d87ac0d..dd60665 100644 --- a/_posts/2009-06-25-moving-a-repo.markdown +++ b/_posts/2009-06-25-moving-a-repo.markdown @@ -10,7 +10,35 @@ This guide details the process of moving a repo to another account. Direct move ----------- -If you wish to move a repo between users or organizations, please [contact support](http://support.github.com/) with details. Make sure that there is not a repo with the same name on the destination account, and that the destination account has unused private repos available if the repo being moved is private. +If you wish to move a repo between users or organizations, please [contact support](http://support.github.com/) following the details below. + +**What to check before creating the support request** + +1. Make sure that there is not a repo with the same name on the destination account. + +2. Make sure the destination account has unused private repos available if the repo being moved is private. + +3. **Please** make sure you login with the account that owns the repositories you want support to move for you. If the repositories belong to different accounts, please create one support request per account. + +**What to include in your support request** + +1. List the repositories you want support to move. + +2. Tell us the destination account (the username) + +**Example** + +*Subject:* Move repositories + +*Repositories* + + myaccount/repoA + myaccount/repoB + myaccount/repoC + +*Destination* + + destinationaccount Existing forks -------------- @@ -28,8 +56,8 @@ First, create a new repo on the target account. Next, create a mirror that incl <pre class="terminal"> git clone --bare url/for/my-old-repo.git -cd my-old-repo +cd my-old-repo.git git push --mirror git@github.com:mycompany/my-new-repo.git cd .. -rm -rf my-old-repo +rm -rf my-old-repo.git </pre> diff --git a/_posts/2009-11-03-userscripts-and-bookmarklets.textile b/_posts/2009-11-03-userscripts-and-bookmarklets.textile index 34f8c9e..01f5325 100644 --- a/_posts/2009-11-03-userscripts-and-bookmarklets.textile +++ b/_posts/2009-11-03-userscripts-and-bookmarklets.textile @@ -18,6 +18,7 @@ h2. GitHub * "Augment GitHub":http://github.com/nakajima/augment-github - Bookmarklet that adds follower, fork, and issue counts to your repos on your dashboard * "User profile gist links":http://gist.github.com/225593 - Adds a link to user profile pages linking to that user's gists * "GitHub Markdown Preview":http://userscripts.org/scripts/show/65788 - Adds a preview to comment fields, so that you may see how your comment looks with the markdown formatted before sending it. +* "Preview Images":https://github.com/yperevoznikov/Preview-Images-In-Github - Adds a preview of images inside issues h2. Gist diff --git a/_posts/2010-01-12-terms.markdown b/_posts/2010-01-12-terms.markdown index 24cbe75..507c5ed 100644 --- a/_posts/2010-01-12-terms.markdown +++ b/_posts/2010-01-12-terms.markdown @@ -89,7 +89,7 @@ F. Copyright and Content Ownership 3. You shall defend GitHub against any claim, demand, suit or proceeding made or brought against GitHub by a third party alleging that Your Content, or Your use of the Service in violation of this Agreement, infringes or misappropriates the intellectual property rights of a third party or violates applicable law, and shall indemnify GitHub for any damages finally awarded against, and for reasonable attorney’s fees incurred by, GitHub in connection with any such claim, demand, suit or proceeding; provided, that GitHub (a) promptly gives You written notice of the claim, demand, suit or proceeding; (b) gives You sole control of the defense and settlement of the claim, demand, suit or proceeding (provided that You may not settle any claim, demand, suit or proceeding unless the settlement unconditionally releases GitHub of all liability); and (c) provides to You all reasonable assistance, at Your expense. -4. The look and feel of the Service is copyright ©2010 GitHub Inc. All rights reserved. You may not duplicate, copy, or reuse any portion of the HTML/CSS, Javascript, or visual design elements or concepts without express written permission from GitHub. +4. The look and feel of the Service is copyright ©{{ site.time | date: "%Y" }} GitHub Inc. All rights reserved. You may not duplicate, copy, or reuse any portion of the HTML/CSS, Javascript, or visual design elements or concepts without express written permission from GitHub. G. General Conditions diff --git a/_posts/2010-01-16-api.markdown b/_posts/2010-01-16-api.markdown index b90ef17..fbc1e41 100644 --- a/_posts/2010-01-16-api.markdown +++ b/_posts/2010-01-16-api.markdown @@ -13,24 +13,25 @@ Projects using the API * [Badjo](http://github.com/zmack/badjo/tree/master) -* [YAGHB](http://github.com/schleyfox/yaghb/tree/master) - Yet another github badge +* [YAGHB](http://github.com/schleyfox/yaghb/tree/master) -- Yet another github badge * [textmate gem](http://github.com/wycats/textmate/) -- Command-line package manager for textmate -* [github commit badge](https://github.com/heipei/github-commit-badge/tree) - GitHub commit badge, showing the most recent commits of chosen repos +* [github commit badge](https://github.com/heipei/github-commit-badge/tree) -- GitHub commit badge, showing the most recent commits of chosen repos -* GitHub Projects Wordpress Plug-in - Available at the official Wordpress [plug-in directory](http://wordpress.org/extend/plugins/github-projects/) +* GitHub Projects Wordpress Plug-in -- Available at the official Wordpress [plug-in directory](http://wordpress.org/extend/plugins/github-projects/) -* [github-repos](http://github.com/johnbender/github-repos/tree/master) - [Tutorial and Example](http://nickelcode.com/2008/11/27/github-repo-information-in-your-webpages/) +* [github-repos](http://github.com/johnbender/github-repos/tree/master) -- [Tutorial and Example](http://nickelcode.com/2008/11/27/github-repo-information-in-your-webpages/) * [github-terminal](http://github.com/prtksxna/github-terminal/tree/master), working example at [Github Terminal](http://prtksxna.github.com/github-terminal/) -* [git-trip](http://github.com/Oshuma/git-trip/tree) - Visualize git repositories. +* [git-trip](http://github.com/Oshuma/git-trip/tree) -- Visualize git repositories. -* [github-social-badge](http://github.com/kentbrew/github-social-badge) - Social badge: visualize projects and followers. [Working example](http://kentbrew.github.com) +* [github-social-badge](http://github.com/kentbrew/github-social-badge) -- Social badge: visualize projects and followers. [Working example](http://kentbrew.github.com) -* [codeigniter-github](http://github.com/philsturgeon/codeigniter-github/tree/master) - CodeIgniter / PHP wrapper library. +* [codeigniter-github](http://github.com/philsturgeon/codeigniter-github/tree/master) -- CodeIgniter / PHP wrapper library. -* [github user page bookmarklet](http://tagaholic.me/2009/04/06/github-bookmarklet-for-user-pages.html) - adds additional repo stats to github user pages and provides repository sorting. +* [github user page bookmarklet](http://tagaholic.me/2009/04/06/github-bookmarklet-for-user-pages.html) -- adds additional repo stats to github user pages and provides repository sorting. -* [GithubNotifier](http://github.com/ctshryock/GithubNotifier) - Little OS X menu-bar app that posts Growl notifications from your Github network activity. +* [GithubNotifier](http://github.com/ctshryock/GithubNotifier) -- Little OS X menu-bar app that posts Growl notifications from your Github network activity. +* [ForkFeed](http://github.com/svetlyak40wt/forkfeed) -- Utility to track changes in all forks of your projects on GitHub. diff --git a/_posts/2010-10-14-git-cheat-sheets.textile b/_posts/2010-10-14-git-cheat-sheets.textile index ffe35af..acbb337 100644 --- a/_posts/2010-10-14-git-cheat-sheets.textile +++ b/_posts/2010-10-14-git-cheat-sheets.textile @@ -12,6 +12,7 @@ h3. Cheat sheets * "http://cheat.errtheblog.com/s/git/":http://cheat.errtheblog.com/s/git/ * Nate Murray's "Git Cheat Sheet":http://www.xcombinator.com/2010/09/01/git-cheat-sheet-and-class-notes/ * "Git - Der Spickzettel":https://github.com/esc/git-cheatsheet-de/ (in German) +* "DZone Git RefCard Cheat Sheet":http://refcardz.dzone.com/refcardz/getting-started-git h3. A practical git guide diff --git a/_posts/2011-03-07-egit-bad-tree.markdown b/_posts/2011-03-07-egit-bad-tree.markdown new file mode 100644 index 0000000..d76eb4b --- /dev/null +++ b/_posts/2011-03-07-egit-bad-tree.markdown @@ -0,0 +1,56 @@ +--- +layout: default +title: Fixing bad tree +description: How to fix the bad tree error on a github repo caused by egit +categories: troubleshooting +--- + +Due to a bug in egit's implementation of the `git rm` command, empty trees may not be removed from the index and result in a "bad tree" error on github: + + + +Fixing the repo +--------------- + +Fixing this error is fairly simple with the commandline. To fix the error you need to recreate the tree and then remove it using `git rm` to ensure it is removed correctly. + +For example, if the bad tree is at `badtree/` we would run: + +<pre class="terminal">tekkub@iSenberg ~/tmp/fixing_bad_tree master +> mkdir badtree + +tekkub@iSenberg ~/tmp/fixing_bad_tree master +> touch badtree/temp + +tekkub@iSenberg ~/tmp/fixing_bad_tree master +> git add badtree/temp + +tekkub@iSenberg ~/tmp/fixing_bad_tree master+ +> git commit -m "Fixing bad tree, step one" +[master dbe6a08] Fixing bad tree, step one + 0 files changed, 0 insertions(+), 0 deletions(-) + create mode 100644 badtree/temp + +tekkub@iSenberg ~/tmp/fixing_bad_tree master +> git rm badtree/temp +rm 'badtree/temp' + +tekkub@iSenberg ~/tmp/fixing_bad_tree master+ +> git commit -m "Fixing bad tree, step two" +[master 46ae6d2] Fixing bad tree, step two + 0 files changed, 0 insertions(+), 0 deletions(-) + delete mode 100644 badtree/temp +</pre> + +we can then confirm the tree is removed by making sure it is not listed by `git ls-tree`: + +<pre class="terminal">tekkub@iSenberg ~/tmp/fixing_bad_tree master +> git ls-tree -r HEAD | grep badtree +</pre> + +If this returns no results, push the repo and everything should be fixed! + +Avoiding future corruption +-------------------------- + +We recommend users avoid using egit to remove files from their repos. Always use `git rm` from the command line. diff --git a/_posts/2011-04-04-leave-a-repo.markdown b/_posts/2011-04-04-leave-a-repo.markdown new file mode 100644 index 0000000..6a95bf9 --- /dev/null +++ b/_posts/2011-04-04-leave-a-repo.markdown @@ -0,0 +1,16 @@ +--- +layout: default +title: Leave a repo +description: Leave a repo you are collaborating on +categories: collaborating +--- + +To leave a repository you are collaborating on: + +_Click "Account Settings"_ > _Click "Repositories"_ + + + +An "x" will show up in the corner of the repositories you can remove. + +None of your commits will be lost. Only the repository owner can [delete repos](/deleting-a-repo/). |
