Permalink
Browse files

Site updated at 2012-11-05 06:28:49 UTC

  • Loading branch information...
1 parent f410b44 commit d96afee3c2b44764a9729f56a814e155bdb9d7f7 @wongyouth committed Nov 5, 2012
Showing with 1,453 additions and 179 deletions.
  1. +113 −3 atom.xml
  2. +8 −7 blog/2012/04/21/install-octopress-to-write-blogs-and-deploy-on-github-dot-com/index.html
  3. +5 −5 blog/2012/04/21/install-ruby-environment-on-ubuntu/index.html
  4. +5 −5 blog/2012/04/26/git-branch/index.html
  5. +5 −5 blog/2012/04/26/git-tagging/index.html
  6. +5 −5 blog/2012/06/18/tmall-za-jin-dan/index.html
  7. +5 −5 blog/2012/06/20/setup-new-ubuntu-environment/index.html
  8. +5 −5 blog/2012/06/25/use-postgresql-with-rails/index.html
  9. +5 −5 blog/2012/06/30/use-mongoid-with-rails/index.html
  10. +5 −5 blog/2012/07/05/rails-development-oriented-vimfiles/index.html
  11. +7 −5 blog/2012/10/25/return-to-old-revision-on-git-repo/index.html
  12. +396 −0 blog/2012/11/05/make-a-git-repo-mirror-for-redmine/index.html
  13. +22 −8 blog/archives/index.html
  14. +108 −1 blog/categories/git/atom.xml
  15. +19 −5 blog/categories/git/index.html
  16. +4 −3 blog/categories/github/atom.xml
  17. +5 −5 blog/categories/github/index.html
  18. +1 −1 blog/categories/mongodb/atom.xml
  19. +5 −5 blog/categories/mongodb/index.html
  20. +1 −1 blog/categories/mongoid/atom.xml
  21. +5 −5 blog/categories/mongoid/index.html
  22. +4 −3 blog/categories/octopress/atom.xml
  23. +5 −5 blog/categories/octopress/index.html
  24. +1 −1 blog/categories/postgresql/atom.xml
  25. +5 −5 blog/categories/postgresql/index.html
  26. +1 −1 blog/categories/rails/atom.xml
  27. +5 −5 blog/categories/rails/index.html
  28. +123 −0 blog/categories/redmine/atom.xml
  29. +219 −0 blog/categories/redmine/index.html
  30. +1 −1 blog/categories/ruby/atom.xml
  31. +5 −5 blog/categories/ruby/index.html
  32. +1 −1 blog/categories/ubuntu/atom.xml
  33. +5 −5 blog/categories/ubuntu/index.html
  34. +1 −1 blog/categories/vim/atom.xml
  35. +5 −5 blog/categories/vim/index.html
  36. +239 −0 blog/page/2/index.html
  37. +42 −0 downloads/code/make-mirror.sh
  38. +50 −49 index.html
  39. +7 −3 sitemap.xml
View
@@ -4,7 +4,7 @@
<title><![CDATA[Wongyouth's Blog]]></title>
<link href="http://wongyouth.github.com/atom.xml" rel="self"/>
<link href="http://wongyouth.github.com/"/>
- <updated>2012-10-26T00:30:06+08:00</updated>
+ <updated>2012-11-05T14:27:27+08:00</updated>
<id>http://wongyouth.github.com/</id>
<author>
<name><![CDATA[Wongyouth]]></name>
@@ -14,6 +14,115 @@
<entry>
+ <title type="html"><![CDATA[redmine用Git repo镜像脚本]]></title>
+ <link href="http://wongyouth.github.com/blog/2012/11/05/make-a-git-repo-mirror-for-redmine/"/>
+ <updated>2012-11-05T14:11:00+08:00</updated>
+ <id>http://wongyouth.github.com/blog/2012/11/05/make-a-git-repo-mirror-for-redmine</id>
+ <content type="html"><![CDATA[<p>一般我用<a href="http://git-scm.com">git</a>来管理代码,后台用<a href="https://github.com/sitaramc/gitolite">gitolite</a>,[redmine][]来管理项目,redmine中可以结合git来参看git提交信息时,非常有用。</p>
+
+<!-- more -->
+
+
+<p>以下代码参照了<a href="http://blog.buginception.com/blog/2012/04/02/redmine-use-git-code-review">http://blog.buginception.com/blog/2012/04/02/redmine-use-git-code-review</a></p>
+
+<figure class='code'><figcaption><span> (make-mirror.sh)</span> <a href='http://wongyouth.github.com/downloads/code/make-mirror.sh'>download</a></figcaption>
+ <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+<span class='line-number'>3</span>
+<span class='line-number'>4</span>
+<span class='line-number'>5</span>
+<span class='line-number'>6</span>
+<span class='line-number'>7</span>
+<span class='line-number'>8</span>
+<span class='line-number'>9</span>
+<span class='line-number'>10</span>
+<span class='line-number'>11</span>
+<span class='line-number'>12</span>
+<span class='line-number'>13</span>
+<span class='line-number'>14</span>
+<span class='line-number'>15</span>
+<span class='line-number'>16</span>
+<span class='line-number'>17</span>
+<span class='line-number'>18</span>
+<span class='line-number'>19</span>
+<span class='line-number'>20</span>
+<span class='line-number'>21</span>
+<span class='line-number'>22</span>
+<span class='line-number'>23</span>
+<span class='line-number'>24</span>
+<span class='line-number'>25</span>
+<span class='line-number'>26</span>
+<span class='line-number'>27</span>
+<span class='line-number'>28</span>
+<span class='line-number'>29</span>
+<span class='line-number'>30</span>
+<span class='line-number'>31</span>
+<span class='line-number'>32</span>
+<span class='line-number'>33</span>
+<span class='line-number'>34</span>
+<span class='line-number'>35</span>
+<span class='line-number'>36</span>
+<span class='line-number'>37</span>
+<span class='line-number'>38</span>
+<span class='line-number'>39</span>
+<span class='line-number'>40</span>
+<span class='line-number'>41</span>
+<span class='line-number'>42</span>
+</pre></td><td class='code'><pre><code class='sh'><span class='line'><span class="c">#!/bin/bash</span>
+</span><span class='line'>
+</span><span class='line'><span class="nb">set</span> -x
+</span><span class='line'>
+</span><span class='line'><span class="k">if</span> <span class="o">[</span> <span class="s2">&quot;$1&quot;</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span> <span class="o">]</span>; <span class="k">then</span>
+</span><span class='line'><span class="k"> </span><span class="nb">echo</span> <span class="s2">&quot;Usage: $0 [repo]&quot;</span>
+</span><span class='line'> <span class="nb">exit </span>1
+</span><span class='line'><span class="k">fi</span>
+</span><span class='line'>
+</span><span class='line'><span class="nv">REPO</span><span class="o">=</span><span class="nv">$1</span>.git
+</span><span class='line'><span class="nv">GIT_BASE</span><span class="o">=</span>/home/git/repositories
+</span><span class='line'><span class="nv">MIRROR_PATH</span><span class="o">=</span>/home/jxb/git-mirrors
+</span><span class='line'><span class="nv">REPO_PATH</span><span class="o">=</span><span class="nv">$MIRROR_PATH</span>/<span class="nv">$REPO</span>
+</span><span class='line'>
+</span><span class='line'><span class="c"># 我們要使用 git clone --mirror 建立一個原始 repo 的鏡像:</span>
+</span><span class='line'><span class="nb">cd</span> <span class="nv">$MIRROR_PATH</span> <span class="o">&amp;&amp;</span> git clone --mirror <span class="nv">$GIT_BASE</span>/<span class="nv">$REPO</span>
+</span><span class='line'>
+</span><span class='line'><span class="c"># 接下來下一步,由於之後 git 使用者會透過 post-receive hook 來同步兩個 repository,</span>
+</span><span class='line'><span class="c"># 我們直接修改這個境像 repository 的 owner / group 為 git 來讓它有讀寫權限。</span>
+</span><span class='line'>chown -R git:git <span class="nv">$REPO_PATH</span>
+</span><span class='line'>
+</span><span class='line'><span class="c"># 再來我們要設定原本 repo 的 hooks :</span>
+</span><span class='line'><span class="nb">cd</span> <span class="nv">$GIT_BASE</span>/<span class="nv">$REPO</span>/hooks
+</span><span class='line'>
+</span><span class='line'>cat &gt; post-receive <span class="s">&lt;&lt;EOS</span>
+</span><span class='line'><span class="s">#!/bin/bash</span>
+</span><span class='line'><span class="s">/usr/bin/git push --mirror $REPO_PATH</span>
+</span><span class='line'><span class="s">EOS</span>
+</span><span class='line'>
+</span><span class='line'><span class="c"># 建立完 post-receive 檔案後修改權限:</span>
+</span><span class='line'>chown git:git post-receive
+</span><span class='line'>chmod 700 post-receive
+</span><span class='line'>
+</span><span class='line'><span class="c"># 由於 Git 在做 mirror push 的時候,會保留原始的檔案與資料夾存取權限,</span>
+</span><span class='line'><span class="c"># 在 gitolite 控管下,只有 owner 有讀寫權限,所以一做 mirror push 這個鏡像的 repository 就沒辦法被其他 process 讀取到了,</span>
+</span><span class='line'><span class="c"># 所以我們一開始就要告訴這個 mirror repository 它是被分享的,並且設定它應該要有的存取權限:</span>
+</span><span class='line'>sudo -u git sh <span class="s">&lt;&lt;EOS</span>
+</span><span class='line'><span class="s">set -x</span>
+</span><span class='line'><span class="s">cd $REPO_PATH</span>
+</span><span class='line'><span class="s">chmod a+rX -R ./</span>
+</span><span class='line'><span class="s">git config --add core.sharedRepository 644</span>
+</span><span class='line'><span class="s">EOS</span>
+</span></code></pre></td></tr></table></div></figure>
+
+
+<p>使用时需要用root权限</p>
+
+<pre><code>sudo sh make-mirror.sh &lt;REPO-NAME&gt; # REPO-NAME 中不带.git后缀
+</code></pre>
+
+<p>如果不需要特别强大的项目管理功能,可以用<a href="https://github.com/gitlabhq/gitlabhq">gitlabhq</a>,这是一个类似<a href="https://github.com">github</a>的代码管理应用,支持fork,pull request功能,也是非常实用。</p>
+]]></content>
+ </entry>
+
+ <entry>
<title type="html"><![CDATA[Git中如何退回到旧版本]]></title>
<link href="http://wongyouth.github.com/blog/2012/10/25/return-to-old-revision-on-git-repo/"/>
<updated>2012-10-25T09:34:00+08:00</updated>
@@ -824,8 +933,9 @@ git checkout source
git clone git@github.com:wongyouth/wongyouth.github.com.git _deploy
</code></pre>
-<p><code>_deploy</code>目录是用来与远程代码库同步的目录,所以我们要把它checkout出来预先做好关联
-make a new post and something else &#8230;</p>
+<p><code>_deploy</code>目录是用来与远程代码库同步的目录,所以我们要把它checkout出来预先做好关联</p>
+
+<p>make a new post and something else &#8230;</p>
<pre><code>rake generate
rake deploy
@@ -217,8 +217,9 @@ <h1 class="entry-title">用octopress来写博客并发布到Github上</h1>
git clone git@github.com:wongyouth/wongyouth.github.com.git _deploy
</code></pre>
-<p><code>_deploy</code>目录是用来与远程代码库同步的目录,所以我们要把它checkout出来预先做好关联
-make a new post and something else &#8230;</p>
+<p><code>_deploy</code>目录是用来与远程代码库同步的目录,所以我们要把它checkout出来预先做好关联</p>
+
+<p>make a new post and something else &#8230;</p>
<pre><code>rake generate
rake deploy
@@ -309,6 +310,10 @@ <h1 class="entry-title">用octopress来写博客并发布到Github上</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/11/05/make-a-git-repo-mirror-for-redmine/">redmine用Git repo镜像脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/10/25/return-to-old-revision-on-git-repo/">Git中如何退回到旧版本</a>
</li>
@@ -324,15 +329,11 @@ <h1 class="entry-title">用octopress来写博客并发布到Github上</h1>
<a href="/blog/2012/06/25/use-postgresql-with-rails/">Ubuntu环境下在Rails项目中使用postgresql时的初始配置</a>
</li>
- <li class="post">
- <a href="/blog/2012/06/20/setup-new-ubuntu-environment/">配置一个新的Ubuntu开发环境</a>
- </li>
-
</ul>
</section>
<section>
<h1>分类</h1>
- <ul id="category-list"><li><a href='/blog/categories/git'>git (3)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
+ <ul id="category-list"><li><a href='/blog/categories/git'>git (4)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/redmine'>redmine (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
</section>
<section>
<h1>近期评论</h1>
@@ -285,6 +285,10 @@ <h1 class="entry-title">Ubuntu下安装ruby开发环境</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/11/05/make-a-git-repo-mirror-for-redmine/">redmine用Git repo镜像脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/10/25/return-to-old-revision-on-git-repo/">Git中如何退回到旧版本</a>
</li>
@@ -300,15 +304,11 @@ <h1 class="entry-title">Ubuntu下安装ruby开发环境</h1>
<a href="/blog/2012/06/25/use-postgresql-with-rails/">Ubuntu环境下在Rails项目中使用postgresql时的初始配置</a>
</li>
- <li class="post">
- <a href="/blog/2012/06/20/setup-new-ubuntu-environment/">配置一个新的Ubuntu开发环境</a>
- </li>
-
</ul>
</section>
<section>
<h1>分类</h1>
- <ul id="category-list"><li><a href='/blog/categories/git'>git (3)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
+ <ul id="category-list"><li><a href='/blog/categories/git'>git (4)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/redmine'>redmine (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
</section>
<section>
<h1>近期评论</h1>
@@ -245,6 +245,10 @@ <h1 class="entry-title">Git分支常用操作</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/11/05/make-a-git-repo-mirror-for-redmine/">redmine用Git repo镜像脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/10/25/return-to-old-revision-on-git-repo/">Git中如何退回到旧版本</a>
</li>
@@ -260,15 +264,11 @@ <h1 class="entry-title">Git分支常用操作</h1>
<a href="/blog/2012/06/25/use-postgresql-with-rails/">Ubuntu环境下在Rails项目中使用postgresql时的初始配置</a>
</li>
- <li class="post">
- <a href="/blog/2012/06/20/setup-new-ubuntu-environment/">配置一个新的Ubuntu开发环境</a>
- </li>
-
</ul>
</section>
<section>
<h1>分类</h1>
- <ul id="category-list"><li><a href='/blog/categories/git'>git (3)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
+ <ul id="category-list"><li><a href='/blog/categories/git'>git (4)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/redmine'>redmine (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
</section>
<section>
<h1>近期评论</h1>
@@ -286,6 +286,10 @@ <h1 class="entry-title">Git标签常用操作</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/11/05/make-a-git-repo-mirror-for-redmine/">redmine用Git repo镜像脚本</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/10/25/return-to-old-revision-on-git-repo/">Git中如何退回到旧版本</a>
</li>
@@ -301,15 +305,11 @@ <h1 class="entry-title">Git标签常用操作</h1>
<a href="/blog/2012/06/25/use-postgresql-with-rails/">Ubuntu环境下在Rails项目中使用postgresql时的初始配置</a>
</li>
- <li class="post">
- <a href="/blog/2012/06/20/setup-new-ubuntu-environment/">配置一个新的Ubuntu开发环境</a>
- </li>
-
</ul>
</section>
<section>
<h1>分类</h1>
- <ul id="category-list"><li><a href='/blog/categories/git'>git (3)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
+ <ul id="category-list"><li><a href='/blog/categories/git'>git (4)</a></li><li><a href='/blog/categories/github'>github (1)</a></li><li><a href='/blog/categories/mongodb'>mongodb (1)</a></li><li><a href='/blog/categories/mongoid'>mongoid (1)</a></li><li><a href='/blog/categories/octopress'>octopress (1)</a></li><li><a href='/blog/categories/postgresql'>Postgresql (1)</a></li><li><a href='/blog/categories/rails'>rails (2)</a></li><li><a href='/blog/categories/rails'>Rails (1)</a></li><li><a href='/blog/categories/redmine'>redmine (1)</a></li><li><a href='/blog/categories/ruby'>ruby (2)</a></li><li><a href='/blog/categories/ubuntu'>ubuntu (2)</a></li><li><a href='/blog/categories/ubuntu'>Ubuntu (1)</a></li><li><a href='/blog/categories/vim'>vim (1)</a></li></ul>
</section>
<section>
<h1>近期评论</h1>
Oops, something went wrong.

0 comments on commit d96afee

Please sign in to comment.