<?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>迁移 &#8211; Simon</title>
	<atom:link href="https://www.luisimon.com/tag/%E8%BF%81%E7%A7%BB/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.luisimon.com</link>
	<description>blog</description>
	<lastBuildDate>Sun, 30 Jun 2024 08:46:06 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>https://www.luisimon.com/wp-content/uploads/2019/09/cbrks-x5t4i-001.ico</url>
	<title>迁移 &#8211; Simon</title>
	<link>https://www.luisimon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SVN仓库迁移到Git（教程）</title>
		<link>https://www.luisimon.com/2023/04/22/697/</link>
		
		<dc:creator><![CDATA[Alan]]></dc:creator>
		<pubDate>Sat, 22 Apr 2023 12:32:41 +0000</pubDate>
				<category><![CDATA[編程三兩事]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[完整迁移]]></category>
		<category><![CDATA[迁移]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=697</guid>

					<description><![CDATA[以下是：把SVN项目仓库整体迁移到Git上，以切换到Git版本控制。 大致流程：通过命令先把SVN库导出到本地 ... <a title="SVN仓库迁移到Git（教程）" class="read-more" href="https://www.luisimon.com/2023/04/22/697/" aria-label="继续阅读SVN仓库迁移到Git（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>以下是：把SVN项目仓库整体迁移到Git上，以切换到Git版本控制。</p>



<p>大致流程：通过命令先把SVN库导出到本地git仓库，再把本地仓库和远端新建仓库关联并推送到远端新仓库库中。</p>



<p>在任意目录右键，单机“Git Bash Here”打开git命令仓库，执行以下语句：</p>



<pre class="wp-block-code"><code>git config --global user.name "Alan"</code></pre>



<p>Alan为用户名称，注意是用户全名，并非有”@“符号那个URL目录名称。</p>



<pre class="wp-block-code"><code>git config --global user.email "Alan@gmail.com"   </code></pre>



<p>用户邮件，即是账号注册登录的电子邮件地址。</p>



<pre class="wp-block-code"><code>git config --list</code></pre>



<p>查看当前配置，可以看见前面设置的用户名称和电子邮件地址。</p>



<pre class="wp-block-code"><code>Alan=Alan&lt;Alan@gmail.com&gt;</code></pre>



<p>创建一个SVN与Git用户名映射的文件，左边是SVN，右边是Git。</p>



<pre class="wp-block-code"><code>git svn clone &#91;-r 282506:HEAD] &#91;svn地址] --no-metadata --authors-file=&#91;用户名映射文件] &#91;git文件夹名称(在当前目录下创建)]</code></pre>



<p>把SVN库导出成git仓库到本地。注意：-r 282506:HEAD是指定导出某一个版本的代码，不加此参数就是完整克隆SVN仓库（所有提交记录），这也是本次的目的。注意：通过SVN客户端在本地创建的库，需要导入到SVN服务端才能导入。在SVN服务端直接导入本地磁盘库目录即可。</p>



<pre class="wp-block-code"><code>cd &#91;git仓库目录]
git remote add origin &#91;git远程地址]
git remote -v #查看是否正确关联
git remote rm origin #取消关联</code></pre>



<p>进入本地git仓库(刚刚从SVN导出创建的git仓库)，并把本地git仓库与远程仓库关联。</p>



<pre class="wp-block-code"><code>git push -u origin master
git pull --rebase origin master #推送失败可以尝试：先拉取远程git项目文件(README.md)</code></pre>



<p>推送本地仓库到远程。</p>



<p>参考出处：https://www.cnblogs.com/mq0036/p/14699655.html</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
