<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Architecting Life &#187; Management</title>
	<atom:link href="http://xujiwei.com/blog/posts/develop/management/feed/" rel="self" type="application/rss+xml" />
	<link>http://xujiwei.com/blog</link>
	<description>Just do it</description>
	<lastBuildDate>Thu, 05 Apr 2012 17:19:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Snow Leopard Server 上配置 Gitosis 笔记</title>
		<link>http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/</link>
		<comments>http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 05:56:04 +0000</pubDate>
		<dc:creator>Xu Jiwei</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Gitosis]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://www.xujiwei.com/blog/?p=313</guid>
		<description><![CDATA[<a href="http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/" title="Snow Leopard Server 上配置 Gitosis 笔记"></a>为了迁移项目 Git 仓库到 Mini Server 上，需要在 Snow Leopard Server 上配置一下 Gitosis，但是 Mac OS X 和 Linux 不太一样，有些地方需要特殊处理一下。 安装 Gitosis Gitosis 的安装就不多说，在参考文档2中有。 添加 Git 用户组及用户 添加用户可以用参考文档1中的方法来创建，没有尝试直接用 OSX 的用户管理来创建是否可用。 # 这里的用户组和用户ID 用 401，但是实际用时需要根据服务器上的情况来创建 # 我在使用时 401 这个 gid 就已经被占用了，可以使用以下两个命令看看要用的 # ID 是否已经被用了。 &#8230;<p class="read-more"><a href="http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/">Read more &#187;</a>]]></description>
			<content:encoded><![CDATA[<a href="http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/" title="Snow Leopard Server 上配置 Gitosis 笔记"></a><p>为了迁移项目 Git 仓库到 Mini Server 上，需要在 Snow Leopard Server 上配置一下 Gitosis，但是 Mac OS X 和 Linux 不太一样，有些地方需要特殊处理一下。</p>

<h3>安装 Gitosis</h3>

<p>Gitosis 的安装就不多说，在参考文档2中有。</p>

<h3>添加 Git 用户组及用户</h3>

<p>添加用户可以用参考文档1中的方法来创建，没有尝试直接用 OSX 的用户管理来创建是否可用。</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># 这里的用户组和用户ID 用 401，但是实际用时需要根据服务器上的情况来创建</span>
<span style="color: #666666; font-style: italic;"># 我在使用时 401 这个 gid 就已经被占用了，可以使用以下两个命令看看要用的</span>
<span style="color: #666666; font-style: italic;"># ID 是否已经被用了。</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . list <span style="color: #000000; font-weight: bold;">/</span>Users uid
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . list <span style="color: #c20cb9; font-weight: bold;">groups</span> gid
&nbsp;
<span style="color: #666666; font-style: italic;"># 创建用户组 git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create groups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create groups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> gid <span style="color: #000000;">401</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># 创建用户 git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> uid <span style="color: #000000;">401</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> NFSHomeDirectory <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> gid <span style="color: #000000;">401</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> UserShell <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . create users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span> Password <span style="color: #ff0000;">'*'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># 创建用户主目录，Git 仓库就要放在里面</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chgrp</span> <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># 下面这一句是把 git 用户添加到可以使用 ssh 访问的用户组里面</span>
<span style="color: #666666; font-style: italic;"># 如果不执行这句的话，git push 或者 git pull 等等的时候会出错</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> dscl . <span style="color: #660033;">-append</span> <span style="color: #000000; font-weight: bold;">/</span>Groups<span style="color: #000000; font-weight: bold;">/</span>com.apple.access_ssh GroupMembership <span style="color: #c20cb9; font-weight: bold;">git</span></pre></div></div>


<h3>配置 Gitosis</h3>

<p>这个在参考文档2中都有详细说明。</p>

<h3>参考文档</h3>

<ol>
<li><a href="http://blog.ardes.com/2008/5/19/git-hosting-with-leopard">git hosting with Leopard</a>, Ian White</li>
<li><a href="http://progit.org/book/zh/ch4-7.html">权限管理器 Gitosis</a>, Pro Git
</li><li><a href="http://punk-apple.livejournal.com/261072.html">Adduser for Mac OS X = dscl + niutil + nicl</a>, otaku ramblings</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://xujiwei.com/blog/configure-gitosis-on-snow-leopard-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion 配置笔记</title>
		<link>http://xujiwei.com/blog/subversion-config-notes/</link>
		<comments>http://xujiwei.com/blog/subversion-config-notes/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:48:51 +0000</pubDate>
		<dc:creator>Xu Jiwei</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[VCS]]></category>

		<guid isPermaLink="false">http://tmp.xujiwei.com/blog/?p=59</guid>
		<description><![CDATA[<a href="http://xujiwei.com/blog/subversion-config-notes/" title="Subversion 配置笔记"></a>在决定转向SVN之后，就去下了个Subversion 1.4.6装上，但是默认的情况下，SVN并不像CVSNT那样提供一下基于网络的访问接口，因此在一开始，我只能用TortoiseSVN使用file:///协议来访问版本库。 这样终究不是个办法，因此去网上找了找，发现SVN本身也提供将SVN安装成服务的方法，只要自己添加一下就行了。使用以下命令： sc create svnserve binpath= &#8221;c:\svnserve\svnserve.exe &#8211;service &#8211;root c:\repos&#8221; displayname= &#8221;Subversion&#8221; depend= tcpip start= auto 注意，如果你是在Vista下面的话，需要使用管理员权限来添加服务。还有一点就是，在输入命令的时候，属性名称后面跟着＝，不能有空格，但是＝与后面的值之间必须有一个空格。 配置之后就可以用svn://协议来访问版本库了。 配置网络访问之后，还需要设置一下访问权限，这个在版本库conf目录里的svnserve.conf里配置。 找到 [general] 段，可以从注释里看到配置匿名访问、密码数据库等等选项。其中 anon-access 是用来设定版本库的匿名访问权限，auth-access 是用来设定登录用户的访问权限，password-db 是用来设定用户密码数据库，一般取默认 passwd 就行了，realm 是用来设定版本库的域，如果两个版本库的的域一样，那么它们就会使用同一个用户密码数据库。 用户权限有 none、read、write 三种，我的配置如下： [general] anon-access = none auth-access = write password-db = passwd realm = my subversion 最后，在同个目录下的 passwd 文件中添加用户名密码即可，格式为“用户名 = 密码”，一行一个帐号。]]></description>
			<content:encoded><![CDATA[<a href="http://xujiwei.com/blog/subversion-config-notes/" title="Subversion 配置笔记"></a><p>在决定转向SVN之后，就去下了个Subversion 1.4.6装上，但是默认的情况下，SVN并不像CVSNT那样提供一下基于网络的访问接口，因此在一开始，我只能用TortoiseSVN使用file:///协议来访问版本库。</p>

<p>这样终究不是个办法，因此去网上找了找，发现SVN本身也提供将SVN安装成服务的方法，只要自己添加一下就行了。使用以下命令：</p>

<blockquote>sc create svnserve binpath= &#8221;c:\svnserve\svnserve.exe &#8211;service
&#8211;root c:\repos&#8221; displayname= &#8221;Subversion&#8221; depend= tcpip start= auto</blockquote>

<p>注意，如果你是在Vista下面的话，需要使用管理员权限来添加服务。还有一点就是，在输入命令的时候，属性名称后面跟着＝，不能有空格，但是＝与后面的值之间必须有一个空格。</p>

<p>配置之后就可以用svn://协议来访问版本库了。</p>

<p>配置网络访问之后，还需要设置一下访问权限，这个在版本库conf目录里的svnserve.conf里配置。</p>

<p>找到 <strong>[general]</strong> 段，可以从注释里看到配置匿名访问、密码数据库等等选项。其中 <strong>anon-access</strong> 是用来设定版本库的匿名访问权限，<strong>auth-access</strong> 是用来设定登录用户的访问权限，<strong>password-db</strong> 是用来设定用户密码数据库，一般取默认 passwd 就行了，<strong>realm</strong> 是用来设定版本库的域，如果两个版本库的的域一样，那么它们就会使用同一个用户密码数据库。</p>

<p>用户权限有 none、read、write 三种，我的配置如下：</p>

<blockquote>[general]
anon-access = none
auth-access = write
password-db = passwd
realm = my subversion</blockquote>

<p>最后，在同个目录下的 passwd 文件中添加用户名密码即可，格式为“用户名 = 密码”，一行一个帐号。</p>
]]></content:encoded>
			<wfw:commentRss>http://xujiwei.com/blog/subversion-config-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

