<?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>svn &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Mon, 30 Dec 2013 14:16:44 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>git subversion</title>
		<link>https://richliu.com/2013/12/30/1593/git-subversion/</link>
					<comments>https://richliu.com/2013/12/30/1593/git-subversion/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 30 Dec 2013 14:16:44 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=1593</guid>

					<description><![CDATA[<p>git 真是很難操控的東西. 好像寫了很多次, 但是都忘記怎麼用.. # git svn clone svn: [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2013/12/30/1593/git-subversion/">git subversion</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>git 真是很難操控的東西. 好像寫了很多次, 但是都忘記怎麼用..<br />
<span id="more-1593"></span><br />
# git svn clone svn://blah blah </p>
<p>Update source code.<br />
# git svn fetch<br />
# git svn rebase </p>
<p>git 不能用 bare 當作 svn 的 repository. 只能用 work repository<br />
所以如果有其他目錄 clone 出去要 commit 進來時, 可以用這個指令</p>
<p># git push origin master:origin<br />
將自己的 master 推到 remote 的 origin 去, 有時候 origin 存在時無法 push, 就換另一個名字再 push. </p>
<p># git push origin master:origin3</p>
<p>然後在原來的 repository 應該就可以 commit 了<br />
# git svn dcommit</p>
<p>如果沒有辦法, 可以切到 master<br />
# git checkout master<br />
再下 cherry-pick (只上 patch), 如果什麼都不下, 就是只上一個 patch<br />
# git cherry-pick origin<br />
如果要上很多 patch<br />
# git cherry-pick start_patch^..end_patch<br />
這邊要用 start_patch 的前一版, 我也不知道為什麼啦. </p>
<p>如果一次改了很多 bug 要分別 patch<br />
可以用<br />
# git add -p<br />
這時候就會一個 diff 一個 diff 列, 命令列還有 s (split), e(edit) 可以將 diff 分成兩個和修改. </p>
<p>做完之後<br />
# git diff &#8211;cached<br />
看己經儲存的 patch<br />
# git commit<br />
不能用 -a , 這樣會連其他的一起 commit </p>
<p>commit 錯了<br />
# git reset HEAD^<br />
可以重新 commit 一次<br />
清除 code.<br />
# git reset &#8211;hard<br />
如果只是打錯 commit 的說明<br />
# git commit &#8211;amend</p>
<p>其他太複雜的就暫時不研究了. </p>
<p>The post <a rel="nofollow" href="https://richliu.com/2013/12/30/1593/git-subversion/">git subversion</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2013/12/30/1593/git-subversion/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
