<?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; 张三太爷</title>
	<atom:link href="https://www.somedoc.net/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.somedoc.net</link>
	<description>看前面，黑洞洞</description>
	<lastBuildDate>Tue, 24 Dec 2019 07:44:23 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>

<image>
	<url>https://www.somedoc.net/wp-content/uploads/2016/12/cropped-dandycheung-1-32x32.jpg</url>
	<title>git &#8211; 张三太爷</title>
	<link>https://www.somedoc.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>GitHub 乾坤大挪移</title>
		<link>https://www.somedoc.net/2019/12/24/github-%e4%b9%be%e5%9d%a4%e5%a4%a7%e6%8c%aa%e7%a7%bb/</link>
					<comments>https://www.somedoc.net/2019/12/24/github-%e4%b9%be%e5%9d%a4%e5%a4%a7%e6%8c%aa%e7%a7%bb/#respond</comments>
		
		<dc:creator><![CDATA[张三太爷]]></dc:creator>
		<pubDate>Tue, 24 Dec 2019 07:44:23 +0000</pubDate>
				<category><![CDATA[备忘录]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[问题解决]]></category>
		<category><![CDATA[git]]></category>
		<guid isPermaLink="false">http://www.somedoc.net/?p=4223</guid>

					<description><![CDATA[数年前从别人那儿 fork 出的一份 mindoc，年久失修 <a href="https://www.somedoc.net/2019/12/24/github-%e4%b9%be%e5%9d%a4%e5%a4%a7%e6%8c%aa%e7%a7%bb/" class="more-link">[&#8230;]</a>]]></description>
										<content:encoded><![CDATA[<p>数年前从别人那儿 fork 出的一份 mindoc，年久失修，加之还有新的功能想添加，上半年的时候委托一位兄弟接手维护起来。</p>
<p>这兄弟看了看我的仓库和原始上游仓库的情况，认为要想从我的仓库往前演进，同时再把原始仓库的迭代融合进来比较麻烦，遂作了一个决定“逆天行事”，从原始仓库拉下代码，本地创建分支，将之前两者之间的差异体现迁移过来，并基于此开发新特性。</p>
<p>光阴荏苒。这位兄弟的代码又轮转回了我的手里，要修补、迭代。完成后发现，往哪个远端提交是个问题。往原始端提交基本不可行，因为不是该项目的 contributor，往自己那份 fork 的仓库里提呢，得动一番手脚。</p>
<p>首先就是要设定和远端之间的关系：<code>git remote add remoterepo https://github.com/username/repo</code> 然后 <code>git push -u remoterepo master</code>。</p>
<p>在这块出了个幺蛾子，我老人家忘记啥时候在网站上把两阶段认证登录打开了，于是命令行里原先记录的登录凭证失效。吊销失效的凭证使用这些命令：<code>sudo git config --system --unset credential.helper</code> 以及 <code>sudo git config --global crendential.helper store</code>。</p>
<p>接下来要使用新的凭证。这又要先到 github.com 站点上登录进去，创建一个 access token（创建时会让选择此 token 允许做的事情有哪些），创建好之后会将 token 显示在页面上，切记，这个显示只有一次，所以要把它记下来，很显然，对其进行全文背诵是没有意义的，复制到你的摘抄或者日记里是个不错的主意。这下可以顺利执行前面的 <code>git push -u</code> 那条命令了，把 token 作为密码在命令行里输入即可。</p>
<p>现在前戏已经做足，直接 <code>git push remoterepo</code> 即可。再到 github.com 站点上查看，则 master 和本地分支均已成功提交上来，完美。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.somedoc.net/2019/12/24/github-%e4%b9%be%e5%9d%a4%e5%a4%a7%e6%8c%aa%e7%a7%bb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
