<?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>git &#8211; Simon</title>
	<atom:link href="https://www.luisimon.com/tag/git/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>git &#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>
		<item>
		<title>CentOS 7 簡單安裝GitLab（教程）</title>
		<link>https://www.luisimon.com/2020/09/19/347/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sat, 19 Sep 2020 02:46:01 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[版本管理]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=347</guid>

					<description><![CDATA[安裝GitLab 1.安装并配置必要的依赖关系 在CentOS 7（和RedHat / Oracle / Sc ... <a title="CentOS 7 簡單安裝GitLab（教程）" class="read-more" href="https://www.luisimon.com/2020/09/19/347/" aria-label="继续阅读CentOS 7 簡單安裝GitLab（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong><em>安裝GitLab</em></strong></p>



<p><strong>1.安装并配置必要的依赖关系</strong></p>



<p>在CentOS 7（和RedHat / Oracle / Scientific Linux 7）上，以下命令还将在系统防火墙中打开HTTP和SSH访问。</p>



<pre class="wp-block-preformatted">sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
</pre>



<p> 接下来，安装Postfix发送通知邮件。如果您想使用其他解决方案发送电子邮件，请跳过此步骤并在安装GitLab后<a href="https://www.luisimon.com/goto/0s0j" rel="nofollow">配置外部SMTP服务器</a>。（不发邮件的话这步可以跳过） </p>



<p><strong> 2.添加GitLab软件包存储库并安装软件包 </strong></p>



<p>如果想手动安装的可以到以下地址下载，国内比较快奥</p>



<p><a href="https://www.luisimon.com/goto/6fhl" rel="nofollow">https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/</a></p>



<p><strong> gitlab 分为gitlab-ce和gitlab-ee，我们要安装ce社区版<br>gitlab-ce是社区版，免费的<br>gitlab-ee是企业版，收费的 </strong></p>



<p>添加GitLab软件包存储库。</p>



<p>curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash</p>



<p><strong>如果要使用国内源</strong></p>



<pre class="wp-block-code"><code>vim /etc/yum.repos.d/gitlab_gitlab-ce.repo</code></pre>



<pre class="wp-block-code"><code>&#91;gitlab-ce]
name=gitlab-ce
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key</code></pre>



<pre class="wp-block-code"><code>vim /etc/yum.repos.d/gitlab_gitlab-ee.repo</code></pre>



<pre class="wp-block-code"><code>&#91;gitlab-ee]
name=gitlab-ee
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/yum/el$releasever/
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key</code></pre>



<p>接下来，安装GitLab软件包。将`http://gitlab.example.com`更改为您想要访问您的GitLab实例的URL。安装将自动在该URL处配置并启动GitLab。安装后HTTPS需要<a href="https://www.luisimon.com/goto/fix2" rel="nofollow">额外的配置</a>。</p>



<p>sudo EXTERNAL_URL=&#8221;http://gitlab.example.com&#8221; yum install -y gitlab-ce</p>



<p>第一次访问时，您将被重定向到密码重置屏幕。提供初始管理员帐户的密码，您将被重定向回登录屏幕。使用默认帐户的用户名root登录。 </p>



<p><strong>4.安装过程中问题处理</strong></p>



<p>执行到&nbsp;sudo EXTERNAL_URL=&#8221;http://gitlab.example.com&#8221; yum install -y gitlab-ce 这个步骤的时候，很大可能被卡死。</p>



<p><em>解决方案：</em></p>



<p><em>1、没关系上趟厕所多等一会（10分钟）<br>2、按住CTRL+C强制结束<br>3、运行：sudo systemctl restart gitlab-runsvdir<br>4、再次执行：sudo gitlab-ctl reconfigure</em></p>



<h4 class="wp-block-heading"><strong>如果访问时报，502 错误</strong></h4>



<p>解决方案：<br></p>



<p>可能性一<br>是unicorn服务与tomcat端口冲突，配置下unicorn使用端口应该就可以了<br>vi /etc/gitlab/gitlab.rb<br>unicorn[&#8216;port&#8217;] = 9090<br></p>



<p>再gitlab-ctl reconfigure 重启配置，然后稍等一会，在访问，这样GitLab服务器就可以正常运行了。</p>



<p><strong>安装/启动postfix的时候报错：</strong></p>



<pre class="wp-block-preformatted"> [root@&nbsp;~]#&nbsp;systemctl&nbsp;start&nbsp;postfix&nbsp;&nbsp;
Job&nbsp;for&nbsp;postfix.service&nbsp;failed&nbsp;because&nbsp;the&nbsp;control&nbsp;process&nbsp;exited&nbsp;with&nbsp;error&nbsp;code.&nbsp;See&nbsp;"systemctl&nbsp;status&nbsp;postfix.service"&nbsp;and&nbsp;"journalctl&nbsp;-xe"&nbsp;for&nbsp;details.&nbsp; </pre>



<p>解决方法：</p>



<pre class="wp-block-preformatted">#修改&nbsp;/etc/postfix/main.cf的设置&nbsp;
inet_protocols&nbsp;=&nbsp;ipv4
inet_interfaces&nbsp;=&nbsp;all</pre>



<p><strong>5.GitLab常用命令</strong></p>



<pre class="wp-block-preformatted">sudo gitlab-ctl start                  # 启动所有 gitlab 组件；
sudo gitlab-ctl stop &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 停止所有 gitlab 组件；
sudo gitlab-ctl restart&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# 重启所有 gitlab 组件；
sudo gitlab-ctl status &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;# 查看服务状态；
sudo gitlab-ctl reconfigure &nbsp; &nbsp; &nbsp; &nbsp; # 启动服务；
sudo vim /etc/gitlab/gitlab.rb &nbsp; &nbsp; &nbsp;# 修改默认的配置文件；
gitlab-rake gitlab:check SANITIZE=true --trace &nbsp; &nbsp;# 检查gitlab；
sudo gitlab-ctl tail &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 查看日志；</pre>



<h4 class="wp-block-heading">完全卸载GitLab</h4>



<p>一、停止gitlab<br> sudo gitlab-ctl stop<br>二、卸载gitlab（这块注意了，看看是gitlab-ce版本还是gitlab-ee版本，别写错误了）<br> sudo rpm -e gitlab-ce<br></p>



<p>三、查看gitlab进程</p>



<p> ps -ef|grep gitlab<br>　 &nbsp; &nbsp;杀掉第一个守护进程(runsvdir -P /opt/gitlab/service log)<br>　 &nbsp; &nbsp;kill -9 4473<br>　 &nbsp; &nbsp;再次查看gitlab进程是否存在<br></p>



<p>四、删除gitlab文件</p>



<p>       <strong> find / -name *gitlab*|xargs rm -rf      # 删除所有包含gitlab的文件及目录</strong></p>



<p>      <strong>  find / -name gitlab |xargs rm -rf </strong><br></p>



<p>删除gitlab-ctl uninstall时自动在root下备份的配置文件（ls /root/gitlab* 看看有没有，有也删除）通过以上几步就可以彻底卸载gitlab </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
