본문으로 건너뛰기
매일 쓰는 Git스테이징

파일 단위로, 또는 헝크 하나만 스테이징

로컬 변경은 내가 바꾼 내용을 스테이징된 것과 되지 않은 것으로 나누고 그 옆에 diff를 함께 보여줍니다.

라이브로 체험하기

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. 파일을 클릭해 diff를 보세요.

  2. diff 블록 위의 헝크 스테이징 을 클릭해 그 부분만 스테이징해 보세요.

  3. 모두 스테이징 을 클릭하고 메시지를 입력한 뒤 스테이징된 항목 커밋 을 누르세요.

  4. 필터 옆 버튼으로 트리 보기와 일반 목록 보기를 전환해 보세요.

  • 위는 미스테이징, 아래는 스테이징됨

    git이 다루는 방식 그대로 두 개의 목록으로 나뉩니다. 파일 하나 또는 여러 개를 선택해 스테이징/스테이징 해제로 옮길 수 있습니다.

  • 한 번에 한 헝크씩

    diff 블록 안에서 클릭해 그 헝크만 스테이징하면 하나의 커밋에 하나의 생각만 담을 수 있습니다.

  • 트리 또는 일반 목록

    변경된 파일을 폴더 구조로 보거나 경로 목록으로 보고 이름으로 필터링할 수 있습니다. 각각 수정, 추가, 삭제, 이름 변경, 충돌 표시가 붙습니다.

  • 기다려 주는 메시지

    커밋 메시지를 쓰다가 탭, 윈도우, 또는 앱을 닫아도 다시 돌아오면 그대로 있습니다. 워크트리마다 초안이 따로 저장됩니다.

  • 모든 파일에 메뉴

    열기, 다른 앱으로 열기, Finder에서 보기, 변경 사항 폐기, 히스토리 보기, 경로 복사를 바로 할 수 있습니다.

  • 스태시

    메시지를 적어 변경 사항을 잠시 치워둘 수 있습니다. 나중에 사이드바에서 스태시를 선택해 내용을 보고 다시 적용하세요.

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 지원.