From 2575b8a597d3febb0088d02fb64214c3dbd5fd57 Mon Sep 17 00:00:00 2001 From: Cameron McEfee Date: Mon, 16 May 2011 10:23:11 -0700 Subject: bring documentation in line with new styles --- _includes/ssh_setup.markdown | 4 +- _layouts/default.html | 1 + _posts/2008-02-16-create-a-repo.markdown | 6 +- _posts/2009-06-13-fork-a-repo.markdown | 6 +- _posts/2009-06-13-linux-set-up-git.markdown | 8 +- _posts/2009-06-13-mac-set-up-git.markdown | 8 +- _posts/2009-06-13-win-set-up-git.markdown | 8 +- _posts/2009-06-17-troubleshooting-ssh.textile | 4 +- _posts/2009-06-20-git-email-settings.markdown | 4 +- _posts/2009-06-25-deleting-a-repo.markdown | 2 +- ...2009-09-03-working-with-key-passphrases.textile | 10 +- _posts/2009-09-09-removing-sensitive-data.markdown | 116 ++++++++------- _posts/2009-10-05-dealing-with-lineendings.textile | 4 +- _posts/2009-10-10-subtree-merge.markdown | 158 +++++++++++---------- _posts/2009-11-17-testing-webhooks.textile | 2 +- _posts/2010-01-16-deploy-keys.markdown | 15 +- _posts/2010-01-17-capistrano.textile | 18 +-- _posts/2010-01-19-managing-clients.markdown | 8 +- _posts/2010-01-29-rebase.markdown | 2 +- _posts/2010-08-29-pull-requests.md | 8 +- _posts/2010-10-14-git-cheat-sheets.textile | 6 +- _posts/2011-02-18-be-social.markdown | 8 +- global/css/documentation.css | 10 +- global/css/pygments.css | 60 ++++++++ 24 files changed, 275 insertions(+), 201 deletions(-) create mode 100644 global/css/pygments.css diff --git a/_includes/ssh_setup.markdown b/_includes/ssh_setup.markdown index 99f9d95..9dfd41a 100644 --- a/_includes/ssh_setup.markdown +++ b/_includes/ssh_setup.markdown @@ -78,7 +78,7 @@ 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, TextEdit, or gedit will do just fine). This is your public SSH key. You may need turn on “view hidden files” to find it because the .ssh directory is hidden. __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. + Open the id_rsa.pub file with a text editor (Notepad, TextEdit, or gedit will do just fine). This is your public SSH key. You may need turn on “view hidden files” to find it because the .ssh directory is hidden. 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.

Can’t view hidden files? Other ways to copy:

@@ -105,7 +105,7 @@ 5. Test everything out. - 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. + 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.
 	$ ssh git@github.comAttempts to ssh to github
diff --git a/_layouts/default.html b/_layouts/default.html
index c5ca453..f1ede0f 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -19,6 +19,7 @@ sidebar_cats:
     
     Help.GitHub - {{ page.title }}
     
+    
     
     
     
diff --git a/_posts/2008-02-16-create-a-repo.markdown b/_posts/2008-02-16-create-a-repo.markdown
index ecfc3fe..1f43a75 100644
--- a/_posts/2008-02-16-create-a-repo.markdown
+++ b/_posts/2008-02-16-create-a-repo.markdown
@@ -7,7 +7,7 @@ categories: bootcamp
 
 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 the basics and explain a little bit about how everything works along the way.
 
-##First: Create A Repo
+##First: Create A Repo
 
 Every time you make a commit with Git, it is stored in a repository (a.k.a. “repo”). To put your project up on GitHub, you’ll need to have a GitHub repository for it to live in.
 
@@ -32,7 +32,7 @@ Every time you make a commit with Git, it is stored in a repository (a.k.a. &ldq
 	
 	Congratulations! You have successfully created your first repo!
 
-##Next: Create a README for your repo.
+##Next: 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.
 
@@ -101,7 +101,7 @@ While a README isn’t a required part of a GitHub repo, it is a good idea t
 	
 	Your README has been created
 	
-##Lastly: Celebrate
+##Lastly: 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?
 
diff --git a/_posts/2009-06-13-fork-a-repo.markdown b/_posts/2009-06-13-fork-a-repo.markdown
index a641b4e..8e8d3e1 100644
--- a/_posts/2009-06-13-fork-a-repo.markdown
+++ b/_posts/2009-06-13-fork-a-repo.markdown
@@ -7,7 +7,7 @@ categories: bootcamp collaborating
 
 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 the basics and explain a little bit about how everything works along the way.
 
-##First: Fork A Repo
+##First: Fork A Repo
 
 At some point you may find yourself wanting to contribute to someone else's project, or would like to use someone's project as the starting point for your own. This is known as “forking.” For this tutorial, we’ll be using the Spoon-Knife project.
 
@@ -51,7 +51,7 @@ You’ve successfully forked the Spoon-Knife repo, but so far it only exists
 	$ git fetch upstreamPulls in any changes not present in your local repository, but doesn't modify your working files
 	
-##Then: More Things You Can Do +##Then: More Things You Can Do You’ve successfully forked a repo, but get a load of these other cool things you can do: @@ -148,7 +148,7 @@ You’ve successfully forked a repo, but get a load of these other cool thin If you are hoping to contribute back to the original fork, you can send the original author a [pull request](/pull-requests/). -##Lastly: Celebrate +##Lastly: Celebrate You have now created forked a repo. What do you want to do next? diff --git a/_posts/2009-06-13-linux-set-up-git.markdown b/_posts/2009-06-13-linux-set-up-git.markdown index 3e82e95..b1968d4 100644 --- a/_posts/2009-06-13-linux-set-up-git.markdown +++ b/_posts/2009-06-13-linux-set-up-git.markdown @@ -7,7 +7,7 @@ categories: linux 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 the basics and explain a little bit about how everything works along the way. -##First: Download and Install Git +##First: 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. @@ -33,7 +33,7 @@ _*If you don’t already know what Git is, Next: 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 involve a number of steps. @@ -75,13 +75,13 @@ To make sure you generate a brand new key, you need to check if one already exis {% include ssh_setup.markdown %} -##Then: Set Up Your Info +##Then: 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. {% include email_setup.markdown %} -##Lastly: Celebrate +##Lastly: Celebrate Congratulations, you now have Git and GitHub all set up! What do you want to do next? diff --git a/_posts/2009-06-13-mac-set-up-git.markdown b/_posts/2009-06-13-mac-set-up-git.markdown index 527d63f..ab060ad 100644 --- a/_posts/2009-06-13-mac-set-up-git.markdown +++ b/_posts/2009-06-13-mac-set-up-git.markdown @@ -7,7 +7,7 @@ categories: mac 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 the basics and explain a little bit about how everything works along the way. -##First: Download and Install Git +##First: 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. @@ -17,7 +17,7 @@ _*If you don’t already know what Git is, Next: 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 involve a number of steps. @@ -59,13 +59,13 @@ To make sure you generate a brand new key, you need to check if one already exis {% include ssh_setup.markdown %} -##Then: Set Up Your Info +##Then: 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. {% include email_setup.markdown %} -##Lastly: Celebrate +##Lastly: Celebrate Congratulations, you now have Git and GitHub all set up! What do you want to do next? diff --git a/_posts/2009-06-13-win-set-up-git.markdown b/_posts/2009-06-13-win-set-up-git.markdown index c9d218c..58310d1 100644 --- a/_posts/2009-06-13-win-set-up-git.markdown +++ b/_posts/2009-06-13-win-set-up-git.markdown @@ -7,7 +7,7 @@ categories: windows 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 the basics and explain a little bit about how everything works along the way. -##First: Download and Install Git +##First: 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. @@ -30,7 +30,7 @@ _*If you don’t already know what Git is, Next: 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 involve a number of steps. @@ -72,13 +72,13 @@ To make sure you generate a brand new key, you need to check if one already exis {% include ssh_setup.markdown %} -##Then: Set Up Your Info +##Then: 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. {% include email_setup.markdown %} -##Lastly: Celebrate +##Lastly: Celebrate Congratulations, you now have Git and GitHub all set up! What do you want to do next? diff --git a/_posts/2009-06-17-troubleshooting-ssh.textile b/_posts/2009-06-17-troubleshooting-ssh.textile index 8900a78..7e58cf8 100644 --- a/_posts/2009-06-17-troubleshooting-ssh.textile +++ b/_posts/2009-06-17-troubleshooting-ssh.textile @@ -6,7 +6,7 @@ categories: troubleshooting popular main_category: troubleshooting --- -This guide contains the solutions to the most common SSH connection issues encountered on GitHub +

This guide contains the solutions to the most common SSH connection issues encountered on GitHub.

The first step to testing your connection is to run ssh git@github.com. If your key works, you should get a success message:
$ ssh git@github.com
@@ -44,7 +44,7 @@ Here we've renamed our keypair to @~/.ssh/id_rsa@.  SSH finds the key and offers
 
 h2. Issues when using sudo
 
-p((. _You shouldn't run @sudo git@ unless you have a very good reason.  If you don't know if you have a good reason to use sudo, it's likely that you do not have one._
+

You shouldn't run @sudo git@ unless you have a very good reason. If you don't know if you have a good reason to use sudo, it's likely that you do not have one.

If you are using sudo with git commands (e.g. using sudo git clone because you are deploying to a root-owned folder), ensure that you also generated the key using sudo. Otherwise, you will have generated a key for your current user, but when you are doing sudo git, you are actually the root user - thus, the keys will not match. diff --git a/_posts/2009-06-20-git-email-settings.markdown b/_posts/2009-06-20-git-email-settings.markdown index 462fd5f..e29eec5 100644 --- a/_posts/2009-06-20-git-email-settings.markdown +++ b/_posts/2009-06-20-git-email-settings.markdown @@ -5,8 +5,8 @@ description: Configure your local git installation so that commits are linked to categories: troubleshooting popular --- -This guide covers basic git settings you should set before making any commits. +

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. +

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-25-deleting-a-repo.markdown b/_posts/2009-06-25-deleting-a-repo.markdown index 2fece16..3b67373 100644 --- a/_posts/2009-06-25-deleting-a-repo.markdown +++ b/_posts/2009-06-25-deleting-a-repo.markdown @@ -5,7 +5,7 @@ description: How to remove a repo from your GitHub account categories: repos --- -_Deleting a private repo will delete all forks of the repo. Deleting a public repo will not._ +

Deleting a private repo will delete all forks of the repo. Deleting a public repo will not.

Go to the repository homepage → Admin: diff --git a/_posts/2009-09-03-working-with-key-passphrases.textile b/_posts/2009-09-03-working-with-key-passphrases.textile index 8941a73..e585983 100644 --- a/_posts/2009-09-03-working-with-key-passphrases.textile +++ b/_posts/2009-09-03-working-with-key-passphrases.textile @@ -5,7 +5,7 @@ description: SSH key passphrases, why you should use them, and how to avoid re-e categories: windows mac troubleshooting --- -This guide will step you through the process of securing your ssh keys while avoiding re-entry of your passphrase every time you use the key. +

This guide will step you through the process of securing your ssh keys while avoiding re-entry of your passphrase every time you use the key.

h2. Why do I need a passphrase? @@ -34,7 +34,7 @@ h2. Auto-launching ssh-agent on msysgit You can run @ssh-agent@ automatically when you open bash by adding the following to your @~/.profile@ or @~/.bashrc@ file: -
+{% highlight bash %}
 SSH_ENV="$HOME/.ssh/environment"
 
 # start the ssh-agent
@@ -80,7 +80,7 @@ else
         start_agent
     fi
 fi
-
+{% endhighlight %} p(. *Note:* If you don't use the default key names, or store your keys in a different path, you will need to add the path to the @/usr/bin/ssh-add@ line so that ssh knows where to find your key. @@ -114,7 +114,7 @@ If you are on OSX Leopard or later, ssh-agent is run automatically for you. It The default key files (@.ssh/id_rsa@, @.ssh/id_dsa@ and @.ssh/identity@) should be handled automatically. If you have a key with a different name, you can add it with @ssh-add path/to/my_key@ -p(. _Make sure that you're using the default OS X ssh-add command and not one installed by macports or some other external source._ +

Make sure that you're using the default OS X ssh-add command and not one installed by macports or some other external source.

When you first try to use the key you will be prompted to enter your passphrase: @@ -122,4 +122,4 @@ When you first try to use the key you will be prompted to enter your passphrase: If you choose to save the passphrase with your keychain, you won't have to enter it again. Instead you'll simply need to unlock your keychain. -p(. This section was written with help from "this guide":http://www.dribin.org/dave/blog/archives/2007/11/28/ssh_agent_leopard/. If you would like to use more paranoid keychain settings like locking after sleep, check out "this guide":http://www.dribin.org/dave/blog/archives/2007/11/28/securing_ssh_agent/. +

This section was written with help from "this guide":http://www.dribin.org/dave/blog/archives/2007/11/28/ssh_agent_leopard/. If you would like to use more paranoid keychain settings like locking after sleep, check out "this guide":http://www.dribin.org/dave/blog/archives/2007/11/28/securing_ssh_agent/.

diff --git a/_posts/2009-09-09-removing-sensitive-data.markdown b/_posts/2009-09-09-removing-sensitive-data.markdown index 776b086..a4e10c4 100644 --- a/_posts/2009-09-09-removing-sensitive-data.markdown +++ b/_posts/2009-09-09-removing-sensitive-data.markdown @@ -18,75 +18,83 @@ Purge the file from your repo Now that the password is changed, you want to remove the file from history and add it to the `.gitignore` to ensure it is not accidentally re-committed. For our examples, we're going to remove `Rakefile` from the [GitHub gem](http://github.com/defunkt/github-gem) repo. - tekkub@iSenberg ~/tmp master* - $ git clone git@github.com:defunkt/github-gem.git - Initialized empty Git repository in /Users/tekkub/tmp/github-gem/.git/ - remote: Counting objects: 1301, done. - remote: Compressing objects: 100% (769/769), done. - remote: Total 1301 (delta 724), reused 910 (delta 522) - Receiving objects: 100% (1301/1301), 164.39 KiB, done. - Resolving deltas: 100% (724/724), done. - - tekkub@iSenberg ~/tmp master* - $ cd github-gem/ - - tekkub@iSenberg ~/tmp/github-gem master - $ git filter-branch --index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD - Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (266/266) - Ref 'refs/heads/master' was rewritten +
+tekkub@iSenberg ~/tmp master*
+$ git clone git@github.com:defunkt/github-gem.git
+Initialized empty Git repository in /Users/tekkub/tmp/github-gem/.git/
+remote: Counting objects: 1301, done.
+remote: Compressing objects: 100% (769/769), done.
+remote: Total 1301 (delta 724), reused 910 (delta 522)
+Receiving objects: 100% (1301/1301), 164.39 KiB, done.
+Resolving deltas: 100% (724/724), done.
+
+tekkub@iSenberg ~/tmp master*
+$ cd github-gem/
+
+tekkub@iSenberg ~/tmp/github-gem master
+$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch Rakefile' HEAD
+Rewrite 48dc599c80e20527ed902928085e7861e6b3cbe6 (266/266)
+Ref 'refs/heads/master' was rewritten
+
This command will run the entire history of the master branch and change any commit that involved the file `Rakefile`, and any commits afterwards. Now that we've erased the file from history, lets ensure that we don't accidentally commit it again. If you wish to retain tags you must specify `--tag-name-filter "cat"`, but note that *this will overwrite your existing tags*. - tekkub@iSenberg ~/tmp/github-gem master - $ echo "Rakefile" >> .gitignore +
+tekkub@iSenberg ~/tmp/github-gem master
+$ echo "Rakefile" >> .gitignore
 
-    tekkub@iSenberg ~/tmp/github-gem master*
-    $ git add .gitignore
+tekkub@iSenberg ~/tmp/github-gem master*
+$ git add .gitignore
 
-    tekkub@iSenberg ~/tmp/github-gem master+
-    $ git commit -m "Add Rakefile to .gitignore"
-    [master 051452f] Add Rakefile to .gitignore
-     1 files changed, 1 insertions(+), 0 deletions(-)
+tekkub@iSenberg ~/tmp/github-gem master+
+$ git commit -m "Add Rakefile to .gitignore"
+[master 051452f] Add Rakefile to .gitignore
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
This would be a good time to double-check that you've removed everything that you wanted to from the history. Note that `git filter-branch` only works on one branch at a time, so you may need to perform the cleanup on other branches as well. This could be problematic if the branch has a complex merge history. If we're happy with the state of the repo, we need to force-push the changes to overwrite the remote repo. - tekkub@iSenberg ~/tmp/github-gem master - $ git push origin master --force - Counting objects: 1074, done. - Delta compression using 2 threads. - Compressing objects: 100% (677/677), done. - Writing objects: 100% (1058/1058), 148.85 KiB, done. - Total 1058 (delta 590), reused 602 (delta 378) - To git@github.com:defunkt/github-gem.git - + 48dc599...051452f master -> master (forced update) +
+tekkub@iSenberg ~/tmp/github-gem master
+$ git push origin master --force
+Counting objects: 1074, done.
+Delta compression using 2 threads.
+Compressing objects: 100% (677/677), done.
+Writing objects: 100% (1058/1058), 148.85 KiB, done.
+Total 1058 (delta 590), reused 602 (delta 378)
+To git@github.com:defunkt/github-gem.git
+ + 48dc599...051452f master -> master (forced update)
+
### Cleanup and reclaiming space While `git filter-branch` rewrites the history for you, the objects will remain in your local repo until they've been dereferenced and garbage collected. If you are working in your main repo you might want to force these objects to be purged. - tekkub@iSenberg ~/tmp/github-gem master - $ rm -rf .git/refs/original/ - - tekkub@iSenberg ~/tmp/github-gem master - $ git reflog expire --expire=now --all - - tekkub@iSenberg ~/tmp/github-gem master - $ git gc --prune=now - Counting objects: 2437, done. - Delta compression using up to 4 threads. - Compressing objects: 100% (1378/1378), done. - Writing objects: 100% (2437/2437), done. - Total 2437 (delta 1461), reused 1802 (delta 1048) - - tekkub@iSenberg ~/tmp/github-gem master - $ git gc --aggressive --prune=now - Counting objects: 2437, done. - Delta compression using up to 4 threads. - Compressing objects: 100% (2426/2426), done. - Writing objects: 100% (2437/2437), done. - Total 2437 (delta 1483), reused 0 (delta 0) +
+tekkub@iSenberg ~/tmp/github-gem master
+$ rm -rf .git/refs/original/
+
+tekkub@iSenberg ~/tmp/github-gem master
+$ git reflog expire --expire=now --all
+
+tekkub@iSenberg ~/tmp/github-gem master
+$ git gc --prune=now
+Counting objects: 2437, done.
+Delta compression using up to 4 threads.
+Compressing objects: 100% (1378/1378), done.
+Writing objects: 100% (2437/2437), done.
+Total 2437 (delta 1461), reused 1802 (delta 1048)
+
+tekkub@iSenberg ~/tmp/github-gem master
+$ git gc --aggressive --prune=now
+Counting objects: 2437, done.
+Delta compression using up to 4 threads.
+Compressing objects: 100% (2426/2426), done.
+Writing objects: 100% (2437/2437), done.
+Total 2437 (delta 1483), reused 0 (delta 0)
+
Note that pushing the branch to a new or empty GitHub repo and then making a fresh clone from GitHub will have the same effect. diff --git a/_posts/2009-10-05-dealing-with-lineendings.textile b/_posts/2009-10-05-dealing-with-lineendings.textile index 8e99023..3296e3d 100644 --- a/_posts/2009-10-05-dealing-with-lineendings.textile +++ b/_posts/2009-10-05-dealing-with-lineendings.textile @@ -5,9 +5,9 @@ description: How to ensure that line endings are consistent in your repo categories: troubleshooting windows mac linux --- -Line endings... the scourge of every Windows-based developer that tries to mingle with linux- or mac-based developers. Though most modern text editors can handle both newline types without issue, git is not as graceful. +

Line endings... the scourge of every Windows-based developer that tries to mingle with linux- or mac-based developers. Though most modern text editors can handle both newline types without issue, git is not as graceful.

-For more info on the issue see "Wikipedia":http://en.wikipedia.org/wiki/Newline. +

For more info on the issue see "Wikipedia":http://en.wikipedia.org/wiki/Newline.

h2. Mac and Linux users, you don't get to sit this one out diff --git a/_posts/2009-10-10-subtree-merge.markdown b/_posts/2009-10-10-subtree-merge.markdown index cca902a..53754e0 100644 --- a/_posts/2009-10-10-subtree-merge.markdown +++ b/_posts/2009-10-10-subtree-merge.markdown @@ -14,102 +14,112 @@ For this example, we'll make an empty "parent" repo and some other repos into it First, set up an empty repo for our example: - [tekkub@tekBook: ~/tmp master*] - $ mkdir test +
+[tekkub@tekBook: ~/tmp master*]
+$ mkdir test
 
-    [tekkub@tekBook: ~/tmp master*]
-    $ cd test
+[tekkub@tekBook: ~/tmp master*]
+$ cd test
 
-    [tekkub@tekBook: ~/tmp/test master*]
-    $ git init
-    Initialized empty Git repository in /Users/tekkub/tmp/test/.git/
+[tekkub@tekBook: ~/tmp/test master*]
+$ git init
+Initialized empty Git repository in /Users/tekkub/tmp/test/.git/
 
-    [tekkub@tekBook: ~/tmp/test master#]
-    $ touch .gitignore
+[tekkub@tekBook: ~/tmp/test master#]
+$ touch .gitignore
 
-    [tekkub@tekBook: ~/tmp/test master#]
-    $ git add .gitignore
+[tekkub@tekBook: ~/tmp/test master#]
+$ git add .gitignore
 
-    [tekkub@tekBook: ~/tmp/test master#]
-    $ git commit -m "initial commit"
-    [master (root-commit) 3146c2a] initial commit
-     0 files changed, 0 insertions(+), 0 deletions(-)
-     create mode 100644 .gitignore
+[tekkub@tekBook: ~/tmp/test master#]
+$ git commit -m "initial commit"
+[master (root-commit) 3146c2a] initial commit
+ 0 files changed, 0 insertions(+), 0 deletions(-)
+ create mode 100644 .gitignore
+
Now we'll subtree-merge the repo [tekkub/cork](https://github.com/tekkub/cork) into the repo at `cork/` - [tekkub@tekBook: ~/tmp/test master] - $ git remote add -f cork git://github.com/tekkub/cork.git - Updating cork - warning: no common commits - remote: Counting objects: 1732, done. - remote: Compressing objects: 100% (750/750), done. - remote: Total 1732 (delta 1086), reused 1558 (delta 967) - Receiving objects: 100% (1732/1732), 528.19 KiB | 621 KiB/s, done. - Resolving deltas: 100% (1086/1086), done. - From git://github.com/tekkub/cork - * [new branch] lastbuffed -> cork/lastbuffed - * [new branch] lock_n_mount -> cork/lock_n_mount - * [new branch] master -> cork/master - * [new branch] nothing_to_see_here -> cork/nothing_to_see_here - - [tekkub@tekBook: ~/tmp/test master] - $ git merge -s ours --no-commit cork/master - Automatic merge went well; stopped before committing as requested - - [tekkub@tekBook: ~/tmp/test master|MERGING] - $ git read-tree --prefix=cork/ -u cork/master - - [tekkub@tekBook: ~/tmp/test master+|MERGING] - $ git commit -m "Subtree merged in cork" - [master fe0ca25] Subtree merged in cork +
+[tekkub@tekBook: ~/tmp/test master]
+$ git remote add -f cork git://github.com/tekkub/cork.git
+Updating cork
+warning: no common commits
+remote: Counting objects: 1732, done.
+remote: Compressing objects: 100% (750/750), done.
+remote: Total 1732 (delta 1086), reused 1558 (delta 967)
+Receiving objects: 100% (1732/1732), 528.19 KiB | 621 KiB/s, done.
+Resolving deltas: 100% (1086/1086), done.
+From git://github.com/tekkub/cork
+ * [new branch]      lastbuffed -> cork/lastbuffed
+ * [new branch]      lock_n_mount -> cork/lock_n_mount
+ * [new branch]      master     -> cork/master
+ * [new branch]      nothing_to_see_here -> cork/nothing_to_see_here
+
+[tekkub@tekBook: ~/tmp/test master]
+$ git merge -s ours --no-commit cork/master
+Automatic merge went well; stopped before committing as requested
+
+[tekkub@tekBook: ~/tmp/test master|MERGING]
+$ git read-tree --prefix=cork/ -u cork/master
+
+[tekkub@tekBook: ~/tmp/test master+|MERGING]
+$ git commit -m "Subtree merged in cork"
+[master fe0ca25] Subtree merged in cork
+
Next, we'll merge in [tekkub/panda](https://github.com/tekkub/panda) into the path `panda/` - [tekkub@tekBook: ~/tmp/test master] - $ git remote add -f panda git://github.com/tekkub/panda.git - Updating panda - warning: no common commits - remote: Counting objects: 974, done. - remote: Compressing objects: 100% (722/722), done. - remote: Total 974 (delta 616), reused 399 (delta 251) - Receiving objects: 100% (974/974), 189.56 KiB, done. - Resolving deltas: 100% (616/616), done. - From git://github.com/tekkub/panda - * [new branch] master -> panda/master - * [new branch] transmute -> panda/transmute - - [tekkub@tekBook: ~/tmp/test master] - $ git merge -s ours --no-commit panda/master - Automatic merge went well; stopped before committing as requested - - [tekkub@tekBook: ~/tmp/test master|MERGING] - $ git read-tree --prefix=panda/ -u panda/master - - [tekkub@tekBook: ~/tmp/test master+|MERGING] - $ git commit -m "Subtree merged in panda" - [master 726a2cd] Subtree merged in panda +
+[tekkub@tekBook: ~/tmp/test master]
+$ git remote add -f panda git://github.com/tekkub/panda.git
+Updating panda
+warning: no common commits
+remote: Counting objects: 974, done.
+remote: Compressing objects: 100% (722/722), done.
+remote: Total 974 (delta 616), reused 399 (delta 251)
+Receiving objects: 100% (974/974), 189.56 KiB, done.
+Resolving deltas: 100% (616/616), done.
+From git://github.com/tekkub/panda
+ * [new branch]      master     -> panda/master
+ * [new branch]      transmute  -> panda/transmute
+
+[tekkub@tekBook: ~/tmp/test master]
+$ git merge -s ours --no-commit panda/master
+Automatic merge went well; stopped before committing as requested
+
+[tekkub@tekBook: ~/tmp/test master|MERGING]
+$ git read-tree --prefix=panda/ -u panda/master
+
+[tekkub@tekBook: ~/tmp/test master+|MERGING]
+$ git commit -m "Subtree merged in panda"
+[master 726a2cd] Subtree merged in panda
+
Finally, we're going to merge the subpath `modules/` from tekkub/cork into `cork2/` - tekkub@iSenberg ~/tmp/test master - $ git merge -s ours --no-commit cork/master - Automatic merge went well; stopped before committing as requested +
+tekkub@iSenberg ~/tmp/test master
+$ git merge -s ours --no-commit cork/master
+Automatic merge went well; stopped before committing as requested
 
-    tekkub@iSenberg ~/tmp/test master|MERGING
-    $ git read-tree --prefix=cork2/ -u cork/master:modules
+tekkub@iSenberg ~/tmp/test master|MERGING
+$ git read-tree --prefix=cork2/ -u cork/master:modules
 
-    tekkub@iSenberg ~/tmp/test master+|MERGING
-    $ git commit -m "Subtree merged in cork/modules"
-    [master f240057] Subtree merged in cork/modules
+tekkub@iSenberg ~/tmp/test master+|MERGING
+$ git commit -m "Subtree merged in cork/modules"
+[master f240057] Subtree merged in cork/modules
+
Pulling in changes ------------------ If the merged repo changes in the future, you can pull in its changes by simply using the `-s subtree` flag: - [tekkub@tekBook: ~/tmp/test master] - $ git pull -s subtree panda master +
+[tekkub@tekBook: ~/tmp/test master]
+$ git pull -s subtree panda master
+
Resources --------- diff --git a/_posts/2009-11-17-testing-webhooks.textile b/_posts/2009-11-17-testing-webhooks.textile index dc3e871..4f46191 100644 --- a/_posts/2009-11-17-testing-webhooks.textile +++ b/_posts/2009-11-17-testing-webhooks.textile @@ -5,7 +5,7 @@ description: How to test post-receive webhook calls from your repo categories: collaborating troubleshooting --- -Testing that a webhook works can be a bit of a pain. Thankfully with the help of "PostBin":http://www.postbin.org/ the pain can be avoided. +

Testing that a webhook works can be a bit of a pain. Thankfully with the help of "PostBin":http://www.postbin.org/ the pain can be avoided.

h2. When hooks are fired diff --git a/_posts/2010-01-16-deploy-keys.markdown b/_posts/2010-01-16-deploy-keys.markdown index fc4962c..c68cff6 100644 --- a/_posts/2010-01-16-deploy-keys.markdown +++ b/_posts/2010-01-16-deploy-keys.markdown @@ -7,32 +7,27 @@ categories: deploying Deploy keys are a handy yet misunderstood feature here on github. This guide will explain when and how to use them instead of normal user keys. -Do you even need a deploy key? -============================== +##Do you even need a deploy key? If your deploy process involves sshing into the server you are deploying to, you probably **do not** need to use deploy keys. Instead, you should use ssh-agent forwarding to temporarily allow the server to use your local ssh keys. Not only is this method easier to maintain, since you don't have any extra keys, but it's also more secure as the server never has keys saved to disk in case of a compromise. As always, you should use a [strong passphrase](/working-with-key-passphrases/) on your keys and let ssh-agent manage them for you. If your deploy process is remotly triggered and you do not log in to the deploying server via ssh, then you might need deploy keys. Read on to find out if you do. -What are deploy keys? -===================== +##What are deploy keys? Deploy keys are ssh keys just like the ones you attach to your account to allow you to push to and pull from your repos. The only difference is that deploy keys are designed to allow access to a single private repo. This will allow your staging or production server to pull in from your repo, most likely using a deploy tool like [Capistrano](http://www.capify.org/). Remember, ssh keys are unique, you cannot use the same key on two repos, or on a repo and a user account. -When should I use a deploy key? -=============================== +##When should I use a deploy key? Simple, when you have a server that needs pull access to a single private repo. -I'm working with public repos, do I still need deploy keys? ------------------------------------------------------------ +###I'm working with public repos, do I still need deploy keys? No! You can simply use the public clone URL for the project. -My server needs access to many private repos, how do I handle this? -------------------------------------------------------------------- +###My server needs access to many private repos, how do I handle this? The simplest way is to add your server's key to the account of the repo owner. This will allow the server access to any private repo that user owns or is a collaborator on. diff --git a/_posts/2010-01-17-capistrano.textile b/_posts/2010-01-17-capistrano.textile index 4365a18..6c351ff 100644 --- a/_posts/2010-01-17-capistrano.textile +++ b/_posts/2010-01-17-capistrano.textile @@ -22,39 +22,39 @@ h2. Settings Here are the 5 most notable Capistrano config options (found in deploy.rb): -
+{% highlight ruby %}
 default_run_options[:pty] = true  # Must be set for the password prompt from git to work
 set :repository, "git@github.com:vanpelt/rails-app.git"  # Your clone URL
 set :scm, "git"
 set :user, "deployer"  # The server's user for deploys
 set :scm_passphrase, "p@ssw0rd"  # The deploy user's password
-
+{% endhighlight %} h3. Agent Forwarding If you're using your own private keys for git you might want to tell Capistrano to use agent forwarding with this command. Agent forwarding can make key management much simpler as it uses your local keys instead of keys installed on the server. -
ssh_options[:forward_agent] = true
+{% highlight ruby %}ssh_options[:forward_agent] = true{% endhighlight %} h3. Set Branch You need to tell cap the branch to checkout during deployment: -
set :branch, "master"
+{% highlight ruby %}set :branch, "master"{% endhighlight %} Older versions of cap need the full branch name: -
set :branch, "origin/master"
+{% highlight ruby %}set :branch, "origin/master"{% endhighlight %} Older versions of git (e.g. 1.4.4.2) don't support @git checkout -q@, this will cause your deployment to fail. To fix either upgrade git or: -
set :scm_verbose, true
+{% highlight ruby %}set :scm_verbose, true{% endhighlight %} h3. Remote Cache In most cases you want to use this option, otherwise each deploy will do a full repository clone every time. -
set :deploy_via, :remote_cache
+{% highlight ruby %}set :deploy_via, :remote_cache{% endhighlight %} Remote caching will keep a local git repo on the server you're deploying to and simply run a fetch from that rather than an entire clone. This is probably the best option as it will only fetch the changes since the last. @@ -62,7 +62,7 @@ h3. Shallow Clone As an alternative to the remote cache approach, you can use shallow cloning. -
set :git_shallow_clone, 1
+{% highlight ruby %}set :git_shallow_clone, 1{% endhighlight %} Shallow cloning will do a clone each time, but will only get the top commit, not the entire repo. This makes it a bit closer to how an svn checkout works. Be warned, shallow clone won't work well with the @set :branch@ option. @@ -70,7 +70,7 @@ h3. Submodules If you're using git submodules you must tell cap to fetch them. -
set :git_enable_submodules, 1
+{% highlight ruby %}set :git_enable_submodules, 1{% endhighlight %} h2. Migrating from SVN diff --git a/_posts/2010-01-19-managing-clients.markdown b/_posts/2010-01-19-managing-clients.markdown index 1f0a267..6f04720 100644 --- a/_posts/2010-01-19-managing-clients.markdown +++ b/_posts/2010-01-19-managing-clients.markdown @@ -5,10 +5,10 @@ description: How to manage multiple clients and their repositories categories: collaborating --- -Are you a freelance developer working on multiple projects for multiple clients, and want to manage them here on GitHub? Never fear, this guide will detail the most common solutions to this problem +

Are you a freelance developer working on multiple projects for multiple clients, and want to manage them here on GitHub? Never fear, this guide will detail the most common solutions to this problem.

One account, multiple collaborators -=================================== +----------------------------------- This design lets you retain control over the repos, but still gives your clients access to them. @@ -17,14 +17,14 @@ This is the simplest (and cheapest) approach. Simply create one account with a If you wish, you can even bill your clients for the cost of your account, and maintaining their repos on it! Multiple accounts, one collaborator -=================================== +----------------------------------- This design gives the control over the repos (and the bill) to your client, but still allows you to push into all your clients' repos from a single account. With this design, have your clients each open their own paid account and create empty repos for each project. Add your account to the repos as a collaborator. You can now push to their repos as if they were your own! Multiple accounts, no collaborators -=================================== +----------------------------------- __This is by far the most complicated setup, and should be avoided if at all possible.__ diff --git a/_posts/2010-01-29-rebase.markdown b/_posts/2010-01-29-rebase.markdown index fd7b9c7..8fce0f6 100644 --- a/_posts/2010-01-29-rebase.markdown +++ b/_posts/2010-01-29-rebase.markdown @@ -7,7 +7,7 @@ categories: everyday_git One often overlooked feature of git is the `git rebase` command. Rebase allows you to easily change a series of commits, reordering, editing, or squashing commits together into a single commit. -_It is considered bad practice to rebase commits which you have already pushed to a remote repo. Doing so may invoke the wrath of the git gods... you have been warned._ +It is considered bad practice to rebase commits which you have already pushed to a remote repo. Doing so may invoke the wrath of the git gods... you have been warned. So, you've cloned a repository, and hacked away at it; separated it into logical chunks, and it's now ready to submit! diff --git a/_posts/2010-08-29-pull-requests.md b/_posts/2010-08-29-pull-requests.md index 2d70538..78a9238 100644 --- a/_posts/2010-08-29-pull-requests.md +++ b/_posts/2010-08-29-pull-requests.md @@ -16,14 +16,14 @@ categories: collaborating } -Pull requests let you tell others about changes you've pushed to a GitHub +

Pull requests let you tell others about changes you've pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if -necessary. +necessary.

-This guide walks through the process of sending a hypothetical pull request and +

This guide walks through the process of sending a hypothetical pull request and using the various code review and management tools to take the change to -completion. +completion.

## A Quick Note on Collaborative Development Models diff --git a/_posts/2010-10-14-git-cheat-sheets.textile b/_posts/2010-10-14-git-cheat-sheets.textile index acbb337..50b5449 100644 --- a/_posts/2010-10-14-git-cheat-sheets.textile +++ b/_posts/2010-10-14-git-cheat-sheets.textile @@ -24,7 +24,7 @@ identify yourself to git: email and your name @git config --global user.name "David Beckwith"@ -@git config --global user.email "dbitsolutions@@@gmail.com"@ +

git config --global user.email "dbitsolutions@gmail.com"

To view all options: @@ -241,7 +241,7 @@ h4. Setting up a repository for use on a remote server Copy up your repository. e.g.: -@scp -r my_project deploy@@@yourbox.com:my_project@ +

scp -r my_project deploy@yourbox.com:my_project

Move your files on the remote server to @/var/git/my_project@ For security make the owner of this project git @@ -253,7 +253,7 @@ Then (for security) restrict the "deploy" user to doing git-related things in @/ h4. Checking out a git repository from a remote to your local storage - @git clone git@@@yourbox.com:/var/git/my_project@ +

git clone git@yourbox.com:/var/git/my_project

h4. Viewing extra info about a remote repository diff --git a/_posts/2011-02-18-be-social.markdown b/_posts/2011-02-18-be-social.markdown index ea90003..2601295 100644 --- a/_posts/2011-02-18-be-social.markdown +++ b/_posts/2011-02-18-be-social.markdown @@ -7,7 +7,7 @@ categories: bootcamp 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 the basics and explain a little bit about how everything works along the way. -##First: Follow A Friend +##First: Follow A Friend One of the great features on GitHub is the ability to see what other people are working on and who they are connecting with. When you follow someone, you will get notifications on your dashboard about their GitHub activity. @@ -47,7 +47,7 @@ One of the great features on GitHub is the ability to see what other people are Congratulations! You are now following a friend. -##Next: Watch A Project +##Next: 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. @@ -61,7 +61,7 @@ At some point you may want to stay up-to-date with a specific project. We’ Congratulations! You are now watching the the Hello World project. If the Octocat updates it, you will see what happened in your dashboard. -##Then: More Things You Can Do +##Then: More Things You Can Do You’ve done some of the most basic social interaction GitHub has to offer, but don’t stop there! Check out these other social features: @@ -83,7 +83,7 @@ You’ve done some of the most basic social interaction GitHub has to offer, Have you found yourself wishing you could collaborate with multiple developers on one project? You can manage everyone with Organizations! With an organization you can establish teams with special permissions, have a public organization profile, and keep track of activity within the organization. -##Lastly: Celebrate +##Lastly: Celebrate Congratulations! You are quite the socialite. What do you want to do next? diff --git a/global/css/documentation.css b/global/css/documentation.css index 4b50e56..4463f52 100644 --- a/global/css/documentation.css +++ b/global/css/documentation.css @@ -60,8 +60,7 @@ a:active { blockquote { margin:0 -5px; - padding:5px 30px 5px 50px; - font-size:14px; + padding: 0px 20px; } ul, @@ -456,12 +455,10 @@ pre { -webkit-background-clip: padding-box; background-clip: padding-box; background-color: #FAFAFB; - white-space: pre-wrap; - white-space: -moz-pre-wrap; - white-space: o-pre-wrap; color: #393939; } +pre code {white-space: pre;} pre span.comment {color: #aaa;} pre.headers { @@ -579,6 +576,9 @@ span.bash-output { color: #63e463; display: block; position: relative; + -moz-user-select: none; + -khtml-user-select: none; + user-select: none; } /* end */ diff --git a/global/css/pygments.css b/global/css/pygments.css new file mode 100644 index 0000000..1e651cf --- /dev/null +++ b/global/css/pygments.css @@ -0,0 +1,60 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #aaaaaa } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ \ No newline at end of file -- cgit v1.3.1