跳至主要內容
日常 Git 操作暫存

暫存整個檔案, 或單一區塊

「本機變更」會展示你修改過的內容,清晰區分為已暫存與未暫存兩部分,並在一旁顯示差異對比。

立即體驗

AgentWorking1 agent · 2 subagents
Branchfeature/checkout-v2↑2 not pushed
Pull request#214 Checkout v2: shipping and payment as separate steps#214 open · mira
Checks CIe3b7a10 · 2/3
Preview deployment Ready28 min ago · 2 commentsstorefront-git-feature-checkout-v2.northpier.dev
Local Changes
Unstaged 4
app
checkout
payment
shipping
docs
lib
cart
Staged 1
app
checkout
app/checkout/payment/page.tsx
@@ -12,9 +12,12 @@ export default async function PaymentPage()
1212 const cart = await getCart();
1313 const address = await savedAddress(cart.customerId);
14- if (!address) redirect("/checkout");
14+ if (!address) redirect("/checkout/shipping");
15+
16+ const methods = await paymentMethods(cart.region);
1517
1618 return (
17- <PaymentForm cart={cart} />
19+ <PaymentForm cart={cart} address={address} methods={methods} />
1820 );
@@ -31,6 +34,7 @@ export const metadata
3134 export const metadata = {
3235 title: "Payment",
36+ robots: { index: false },
3337 };

試試看

  1. 按一下一個檔案查看它的差異對比。

  2. 按一下差異區塊上方的 暫存區塊,只暫存那一部分變更。

  3. 按一下 全部暫存,輸入提交訊息,然後按一下 提交已暫存變更。

  4. 使用過濾框旁的按鈕在樹狀檢視與平面清單之間切換。

  • 上方未暫存,下方已暫存

    兩個清單完全契合 git 的工作方式。選取一個或多個檔案,透過「暫存」或「取消暫存」在兩欄間移動。

  • 一次一個區塊

    按一下差異中的某個區塊,只暫存該區塊,讓每次提交都專注於單一改動。

  • 樹狀或平面清單

    依資料夾層級查看變更檔案,或切換為純路徑清單,並支援依名稱過濾。每個檔案都標有已修改、新增、刪除、重新命名或衝突狀態。

  • 不會遺失的提交訊息

    如果你寫了一半提交訊息後關閉了標籤頁、視窗或整個應用程式,回來時它依然完好無損。每個工作樹都有獨立的草稿。

  • 每個檔案都有選單

    可以直接開啟檔案、用其他應用程式開啟、在 Finder 中顯示、放棄變更、查看歷史紀錄或複製路徑。

  • 暫存區(Stash)

    附帶說明將目前變更暫時擱置到一旁。之後在側邊欄選取該 Stash 即可查看內容並套用。

Questions, *answered*

Can I stage only part of a file?
Yes. Click in a block of the diff and Stage hunk stages only that part, so one commit holds one idea.
Do I lose my commit message if I close the window?
No. If you start a commit message and close the tab, the window or the app, it is still there when you come back. There is a draft for each worktree.

繼續探索

全部功能

下載 gitā

免費。支援 macOS 14 或更新版本,相容 Apple silicon 與 Intel。