<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Git on LCY's Notes</title><link>https://blog.lcy.one/tags/git/</link><description>Recent content in Git on LCY's Notes</description><generator>Hugo</generator><language>zh-tw</language><copyright>lcy</copyright><lastBuildDate>Thu, 13 Jul 2017 00:00:00 +0800</lastBuildDate><atom:link href="https://blog.lcy.one/tags/git/feed.xml" rel="self" type="application/rss+xml"/><item><title>Git for Windows 與 MacType 神奇的衝突</title><link>https://blog.lcy.one/2017/07/13/git-for-windows-incompatible-with-mactype.html</link><pubDate>Thu, 13 Jul 2017 00:00:00 +0800</pubDate><guid>https://blog.lcy.one/2017/07/13/git-for-windows-incompatible-with-mactype.html</guid><description>&lt;p&gt;今天在 Windows 7 上用 Git Bash 的時候&lt;br&gt;
遇到了一些奇怪的問題&lt;br&gt;
主要是下 git rebase -i &amp;hellip; 的時候&lt;br&gt;
一直跳出&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is no tracking information for the current branch.&lt;br&gt;
Please specify which branch you want to rebase against.&lt;/p&gt;
&lt;/blockquote&gt;</description><content:encoded><![CDATA[<p>今天在 Windows 7 上用 Git Bash 的時候<br>
遇到了一些奇怪的問題<br>
主要是下 git rebase -i &hellip; 的時候<br>
一直跳出</p>
<blockquote>
<p>There is no tracking information for the current branch.<br>
Please specify which branch you want to rebase against.</p>
</blockquote>
<p>可是之前在 Windows 10 上用 Bash on Windows 下這指令的時候都沒問題<br>
Google 了一下才發現有人發過這個 issue<br>
解法竟然是&hellip;&hellip; 關掉 MacType<br>
<a href="https://github.com/git-for-windows/git/issues/710">when i git rebase -i error · Issue #710 · git-for-windows/git</a></p>
<blockquote>
<p>&hellip; I added <code>bash.exe</code> to MacType utility exclusion list, now all is good.</p>
</blockquote>
<p>相關討論和 issue 可以點進去看<br>
剛看到這解法還以為他來亂的<br>
結果我把 MacType 暫時停用後<br>
什麼問題都解決了&hellip;</p>]]></content:encoded></item><item><title>切割 Git Repo、並更改其部分內容</title><link>https://blog.lcy.one/2017/03/04/split-and-modify-git-repos.html</link><pubDate>Sat, 04 Mar 2017 00:00:00 +0800</pubDate><guid>https://blog.lcy.one/2017/03/04/split-and-modify-git-repos.html</guid><description>&lt;p&gt;因為一些原因&lt;br&gt;
想把某個 Git Repo 中的資料夾另外分出來&lt;br&gt;
分出來之後又發現其中當初不該丟上去的東西&lt;/p&gt;</description><content:encoded><![CDATA[<p>因為一些原因<br>
想把某個 Git Repo 中的資料夾另外分出來<br>
分出來之後又發現其中當初不該丟上去的東西</p>
<p>我又對 git 不熟Orz<br>
就邊 Google 邊想辦法弄出來<br>
在這做個紀錄</p>
<hr>
<ol>
<li>先 clone 下來。<br>
<code>git clone [Repo位址]</code></li>
<li>切換目錄。<br>
<code>cd [目錄名稱]</code></li>
<li>rebase -i 到欲更改 commit 的 parent commit。<br>
<code>git rebase -i [欲更改commit的sha]^1</code></li>
<li>想改的改一改，想刪的刪一刪。<br>
詳情參照參考資料中的教學。</li>
<li>更新檔案變動。<br>
<code>git add -A</code></li>
<li>修改 commit。<br>
<code>git commit --amend</code></li>
<li>rebase 回去。<br>
<code>git rebase --continue</code></li>
<li>把要留的資料夾切出來。<br>
<code>git filter-branch --prune-empty --subdirectory-filter [資料夾名稱]</code></li>
<li>更改遠端 Repo 的位址。<br>
<code>git remote set-url origin [Repo位址]</code></li>
<li>Push，完成。<br>
<code>git push -u origin [BRANCH名]</code></li>
</ol>
<hr>
<h2 id="參考資料">參考資料</h2>
<ul>
<li><a href="https://docs.github.com/en/github/getting-started-with-github/splitting-a-subfolder-out-into-a-new-repository">Splitting a subfolder out into a new repository - GitHub Docs</a></li>
<li><a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History">Git - Rewriting History</a></li>
<li><a href="https://backlogtool.com/git-guide/tw/stepup/stepup7_6.html">6. 使用 rebase -i 修改提交【教學3 改寫提交】 | 連猴子都能懂的Git入門指南 | 貝格樂（Backlog）</a></li>
</ul>]]></content:encoded></item></channel></rss>