diff options
Diffstat (limited to '_posts')
| -rw-r--r-- | _posts/2009-06-17-troubleshooting-ssh.textile | 3 | ||||
| -rw-r--r-- | _posts/2009-09-09-removing-sensitive-data.textile | 15 | ||||
| -rw-r--r-- | _posts/2009-10-16-post-receive-hooks.textile | 2 | ||||
| -rw-r--r-- | _posts/2009-11-03-userscripts-and-bookmarklets.textile | 24 | ||||
| -rw-r--r-- | _posts/2009-11-16-egit-corruption.textile | 44 | ||||
| -rw-r--r-- | _posts/2009-11-17-testing-webhooks.textile | 66 |
6 files changed, 153 insertions, 1 deletions
diff --git a/_posts/2009-06-17-troubleshooting-ssh.textile b/_posts/2009-06-17-troubleshooting-ssh.textile index 109750e..be33dd0 100644 --- a/_posts/2009-06-17-troubleshooting-ssh.textile +++ b/_posts/2009-06-17-troubleshooting-ssh.textile @@ -2,7 +2,8 @@ layout: default title: Troubleshooting SSH issues description: Solutions to common SSH issues -categories: setup +categories: setup troubleshooting +main_category: troubleshooting --- This guide contains the solutions to the most common SSH connection issues encountered on GitHub diff --git a/_posts/2009-09-09-removing-sensitive-data.textile b/_posts/2009-09-09-removing-sensitive-data.textile index b0c558a..1d0b29b 100644 --- a/_posts/2009-09-09-removing-sensitive-data.textile +++ b/_posts/2009-09-09-removing-sensitive-data.textile @@ -52,6 +52,21 @@ Total 1058 (delta 590), reused 602 (delta 378) To git@github.com:defunkt/github-gem.git + 48dc599...051452f master -> master (forced update)</pre> +h3. 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. + +<pre class="terminal">[tekkub@tekBook: ~/tmp/github-gem master] $ rm -rf .git/refs/original/ +[tekkub@tekBook: ~/tmp/github-gem master] $ git reflog expire --all +[tekkub@tekBook: ~/tmp/github-gem master] $ git gc --aggressive --prune +Counting objects: 1746, done. +Delta compression using 2 threads. +Compressing objects: 100% (1736/1736), done. +Writing objects: 100% (1746/1746), done. +Total 1746 (delta 993), reused 0 (delta 0)</pre> + +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. + h2. Dealing with collaborators You may have collaborators that pulled your tainted branch and created their own branches off of it. After they fetch your new branch, they will need to use @git rebase@ on their own branches to rebase them on top of the new one. The collab should also ensure that their branch doesn't reintroduce the file, as this will override the @.gitignore@ file. *Make sure your collab uses rebase and not merge,* otherwise he will just reintroduce the file and the entire tainted history... and likely encounter some merge conflicts. diff --git a/_posts/2009-10-16-post-receive-hooks.textile b/_posts/2009-10-16-post-receive-hooks.textile index ae27cfc..056ccb1 100644 --- a/_posts/2009-10-16-post-receive-hooks.textile +++ b/_posts/2009-10-16-post-receive-hooks.textile @@ -5,6 +5,8 @@ description: Working with GitHub's post-receive web hooks. categories: collaborating --- +p(. _For help testing webhooks, see "this guide":/testing-webhooks_ + If you supply a post-receive URL, GitHub will POST to that URL when someone uses <code>git push</code> on that repository. <img src="http://img.skitch.com/20090814-ksn6tk94h8is3ddgsxmsmuxk4s.jpg"/> diff --git a/_posts/2009-11-03-userscripts-and-bookmarklets.textile b/_posts/2009-11-03-userscripts-and-bookmarklets.textile new file mode 100644 index 0000000..8457075 --- /dev/null +++ b/_posts/2009-11-03-userscripts-and-bookmarklets.textile @@ -0,0 +1,24 @@ +--- +layout: default +title: Userscripts and Bookmarklets +description: Various bits of code to enhance and personalize GitHub +categories: other +--- + +This page contains userscripts and bookmarklets to enhance and customize GitHub. If you have a link to add, please "fork this repo":http://github.com/help/help.github.com. + +Userscripts can be installed by simply visiting the "raw" version of the gist or github page. Your browser should prompt you to install the userscript if it recognizes it. See "this post":http://github.com/blog/302-gist-for-greasemonkey for details. + +Bookmarklets should provide their own installation instructions. + +h2. GitHub + +* "GitHubbub":http://github.com/stephencelis/githubbub - Growl notifications for the dashboard events +* "Dashboard twitter status":http://gist.github.com/225512 - Adds the two most recent, non-reply tweets from @github to your dashboard +* "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 + +h2. Gist + +* "Replace page title with filename":http://gist.github.com/93187 +* "Diff for gist":http://gist.github.com/105913 diff --git a/_posts/2009-11-16-egit-corruption.textile b/_posts/2009-11-16-egit-corruption.textile new file mode 100644 index 0000000..7d8343c --- /dev/null +++ b/_posts/2009-11-16-egit-corruption.textile @@ -0,0 +1,44 @@ +--- +layout: default +title: Fixing egit corruption +description: How to fix corruption in a remote repo caused by egit +categories: troubleshooting +--- + +Due to a bug in egit's impementation of the @git push@ command, remote repos can become corrupted due to missing objects: + +<pre class="terminal">$ git fsck +broken link from commit 5b90a930763c442f0fc3d819685083b4eda69f8e + to commit e1ea55d308b7808cb982f509c8dfa199ada4677e +missing commit e1ea55d308b7808cb982f509c8dfa199ada4677e</pre> + +This can prevent cloning and fetching from the repo. The objects were never pushed to the remote repo, therefore support cannot recover the repo directly for the user. The only solution is for the user that pushed the commits to push them again from the command line. + +h2. Correcting the remote repo + +To correct the remote repo the missing objects need to be re-pushed from an uncorrupted repo. This should be done from the command line, not from egit. To start, run @git fsck@ on your local repo to ensure it has not been corrupted. If you do not receive any errors about broken links or missing objects, you're clear to continue. + +Re-pushing is a simple matter of deleting the remote branch and then pushing it again. + +<pre class="terminal">$ git push origin :master +$ git push origin master</pre> + +You may need to do this for many branches if the remote repo has more than one branch that was pushed by egit. If one of the branches that was re-pushed was the default branch (usually master), you'll need to re-establish that default: + +<pre class="terminal">$ git remote set-head origin master</pre> + +After you've pushed and reset HEAD, testing the repo repo is just a matter of cloning it: + +<pre class="terminal">[tekkub@tekBook: ~/tmp] $ git clone git://github.com/tekkub/test.git +Initialized empty Git repository in /Users/tekkub/tmp/test/.git/ +remote: Counting objects: 1815, done. +remote: Compressing objects: 100% (838/838), done. +remote: Total 1815 (delta 1139), reused 1552 (delta 961) +Receiving objects: 100% (1815/1815), 537.69 KiB | 549 KiB/s, done. +Resolving deltas: 100% (1139/1139), done.</pre> + +If you have re-pushed all branches in your repo and cloning still fails, please "contact support":http://support.github.com and open a ticket. Be sure to include a link to your repo and mention that you've already performed the steps on this page. + +h2. Avoiding future corruption + +We recommend users avoid using egit to push their repos. Always push from the command line.
\ No newline at end of file diff --git a/_posts/2009-11-17-testing-webhooks.textile b/_posts/2009-11-17-testing-webhooks.textile new file mode 100644 index 0000000..6fe72d4 --- /dev/null +++ b/_posts/2009-11-17-testing-webhooks.textile @@ -0,0 +1,66 @@ +--- +layout: default +title: Testing webhooks +description: How to test post-receive webhook calls from your repo +categories: collaborating troubleshooting +main_category: 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. + +h2. When hooks are fired + +First and foremost, webhooks are not always called when a push is made. Currently hooks only fire when a branch that exists on GitHub is modified. Pushing new branches, deleting branches, and creating tags will not fire a webhook. Forced pushes such as @git push origin master --force@ may not predictably call hooks as well. To ensure your commits are sent to your webhook, always push the branch when it is created before you commit. This way the branch exists on GitHub when you push the commits you want sent to the webhook. + +h2. Setting up + +First, visit "PostBin":http://www.postbin.org/ and click "Make a PostBin". Copy the URL you are sent to: + +!http://img.skitch.com/20091118-jp5jt8gtcxy8dn2w3kk1xkpt8j.jpg! + +Paste this URL into your repo's post-receive URLs setting and save: + +!http://img.skitch.com/20091118-nr8ggc3rgdq8i1r2x8ad1mm57r.jpg! + +h2. Testing the hook is fired + +To test that the hook fires we need an existing branch on the GitHub repo. In this example we create a new repo, push one commit, then make another commit and push it. We only expect the second push to be sent to our PostBin. + +<pre class="terminal">[tekkub@tekBook: ~/tmp] $ mkdir test_post +[tekkub@tekBook: ~/tmp] $ cd test_post +[tekkub@tekBook: ~/tmp/test_post] $ git init +Initialized empty Git repository in /Users/tekkub/tmp/test_post/.git/ + +[tekkub@tekBook: ~/tmp/test_post master#] $ touch README +[tekkub@tekBook: ~/tmp/test_post master#] $ git add README +[tekkub@tekBook: ~/tmp/test_post master#] $ git commit -m 'first commit' +[master (root-commit) 94afb6c] first commit + 0 files changed, 0 insertions(+), 0 deletions(-) + create mode 100644 README + +[tekkub@tekBook: ~/tmp/test_post master] $ git remote add origin git@github.com:tekkub/test_post.git +[tekkub@tekBook: ~/tmp/test_post master] $ git push origin master +Counting objects: 3, done. +Writing objects: 100% (3/3), 201 bytes, done. +Total 3 (delta 0), reused 0 (delta 0) +To git@github.com:tekkub/test_post.git + * [new branch] master -> master + +[tekkub@tekBook: ~/tmp/test_post master] $ echo "This is a real edit" > README +[tekkub@tekBook: ~/tmp/test_post master*] $ git add README +[tekkub@tekBook: ~/tmp/test_post master+] $ git commit -m 'second commit' +[master a58cf12] second commit + 1 files changed, 1 insertions(+), 0 deletions(-) + +[tekkub@tekBook: ~/tmp/test_post master] $ git push origin master +Counting objects: 5, done. +Writing objects: 100% (3/3), 249 bytes, done. +Total 3 (delta 0), reused 0 (delta 0) +To git@github.com:tekkub/test_post.git + 94afb6c..a58cf12 master -> master</pre> + +Now that we've pushed a commit that should be sent to our webhook, lets check if it did by reloading our PostBin page: + +!http://img.skitch.com/20091118-rgxb1rx3aixqfdk4sm5wtaw4t7.jpg! + +Success!
\ No newline at end of file |
