레슨 24 · 회복
활성 작업 계속, 건너뛰기 또는 중단
병합 또는 리베이스가 중지되면 계속, 건너뛰기 또는 중단의 세 가지 방법이 있습니다. 어느 것이 적합한지, 각각 무엇을 버리는지, 나중에 저장소를 확인하는 방법을 알아보세요.
- 레벨: 중급
- 10분 읽음
- 7분 동영상
- 업데이트됨
- 이 수업 전에: 병합 및 리베이스 충돌 해결
이 브라우저에 진행 상황이 저장되었습니다.
재생하면 YouTube에서 동영상이 로드됩니다(개인정보 보호 강화 모드).
무엇을 배울 것인가
- 무엇이든 만지기 전에 어떤 작업이 활성화되어 있는지 알려주세요.
- 모든 충돌이 해결되고 표시된 후에만 계속하십시오.
- Skip이 생략한 것이 무엇인지, 그리고 언제 그것이 잘못된 도구인지 설명하십시오.
- 작업을 중단하고 처음으로 돌아왔는지 확인하세요.
시작하기 전에
23과의 분기인 conflict/sara(Sara의 제목 "자신있게 변경 사항 검토") 및 conflict/omar(Omar의 "저장된 각 변경 사항 이해")의 차이점을 사용합니다. 둘 다 커밋 M에서 가져온 것입니다. gittree-continue, gittree-abort 및 gittree-skip라는 이름의 깨끗한 복사본 3개를 만듭니다. 각각에서 conflict/sara은(는) 체크아웃되었으며 아무것도 실행되지 않습니다. 세 가지 모두에서 동일한 작업을 중지하고 각각 다른 방식으로 둡니다.
모든 것이 로컬이며 무료 요금제(GitTree에서 로그인을 요청함)입니다. 호스팅 계정도 없고, 공급자도 없고, 인터넷도 없습니다. 모든 신원은 허구입니다(example.com). 실제 프로젝트에서는 이 강의를 실행하지 마세요.
동일한 사본에서 둘 다 수행하지 말고 GitTree 또는 기본 Git 명령을 사용하여 변경하십시오. 결과를 읽는 것은 항상 안전합니다. 메뉴 라벨은 GitTree 2.0의 자체 문자열에서 왔으며 기본 명령은 일회용 복사본에서 Git 2.43을 사용하여 실행되었습니다. GitTree 단계가 macOS, Windows 또는 Linux에서 실행되지 않았습니다.
개념 및 상태 효과
중지된 작업은 그 자체의 상태입니다. 끝날 때까지 저장소는 자신이 수행한 작업을 기억하므로 그 위에서 다른 병합이나 리베이스를 시작하면 안 됩니다. 먼저 무엇이 활성화되어 있는지 알아보세요. GitTree의 배너에는 "...을 ...로 병합" 또는 "...을 ...에 다시 적용"(여러 개가 있는 경우 단계 번호 포함) 및 남은 충돌 수가 명시되어 있습니다. 터미널에서 git status는 "병합되지 않은 경로가 있습니다"와 병합에 대한 힌트로 시작하거나 리베이스에 대해 "대화형 리베이스 진행 중, ...으로"로 시작한 다음 사용할 수 있는 명령을 나열합니다.
Continue은 모든 충돌이 해결되고 그 결과가 준비되면 계속됩니다. 이는 원래 병합 또는 리베이스를 다시 시도하는 것이 아닙니다. 병합 커밋을 완료하거나 리베이스를 다음 커밋으로 이동합니다.
리베이스와 같이 커밋을 재생하는 작업에 대해 Skip가 존재합니다. 현재 커밋의 변경 사항을 결과에서 완전히 제외합니다. 이 레슨에서 Skip은 Sara의 제목을 삭제하고 분기는 Omar의 커밋에서 끝납니다. 이는 "파일을 승인"하거나 충돌을 연기하는 방법이 아니며, 여전히 변경을 원할 때마다 잘못된 도구입니다. 병합은 건너뛰기가 없습니다. 병합은 한 단계이므로 완료하거나 중단할 수 있습니다.
Abort는 작업이 시작된 곳으로 돌아갑니다. 지금까지 해결한 내용은 삭제됩니다. GitTree는 먼저 삭제한 항목의 복구 스냅샷을 저장하고 저장소는 이전에 있던 정확한 커밋, 인덱스 및 파일로 돌아갑니다. 자신이 무엇을 하고 있는지 확신이 없을 때 나가는 방법입니다.
| 선택 | 결과 | 비용 |
|---|---|---|
| 계속 | 병합 커밋이 이루어졌거나 다음 커밋이 재생되었습니다. | 아무것도 아니야 다 해결되면 |
| 건너뛰기 | 현재 커밋의 변경 사항은 생략됩니다. | 그 변화, 다시 찾을 때까지 |
| 중단 | 저장소가 처음으로 돌아왔습니다. | 수술 중 수행된 작업 |
정확한 프로젝트 상태 준비
Sara와 Omar의 가지를 한 번 만든 다음 복사본을 세 개 만드세요. 18과에서 남겨둔 프로젝트의 별도의 일반 복사본에서 시작하고 원본 gittree-features은 그대로 둡니다. 페이지 버전: MERGED는 공유 기반이고 SARA 및 OMAR은 경쟁 버전이며 RESOLVED는 계속 사본에 저장한 결과입니다.
완전한 파일 입력
아래에 명명된 단계에서만 저장하십시오. 이는 최종 개행 문자가 포함된 완전한 UTF-8/LF 본문입니다. 마크다운 펜스를 붙여넣지 마세요. 변경되지 않은 실행 가능 파일은 명명된 입력을 상속합니다. 별도의 변형 버전이 원본을 덮어쓰면 안 됩니다.
index.html — 병합됨
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitTree Features — course demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="site-header">
<a href="#main">GitTree Features</a>
</header>
<main id="main" tabindex="-1">
<section class="hero" aria-labelledby="hero-title">
<p class="eyebrow">GitTree Learn demo project</p>
<h1 id="hero-title">See your work clearly.</h1>
<p id="hero-copy">Choose one change, then check what Git saved.</p>
</section>
<section class="features" aria-labelledby="features-title">
<h2 id="features-title">Follow your work</h2>
<div class="cards">
<article class="feature-card">
<h3>History</h3>
<p>Read commits and branches together.</p>
</article>
<article class="feature-card">
<h3>Changes</h3>
<p>Review the exact content selected for a commit.</p>
</article>
<article class="feature-card">
<h3>Recovery</h3>
<p>Inspect the scope of a recovery point before using it.</p>
</article>
</div>
</section>
<section aria-labelledby="plans-title">
<h2 id="plans-title">Choose the workflow you need</h2>
<div class="cards">
<article class="feature-card">
<h3>Local Git</h3>
<p>Local Git workflows work without signing in.</p>
</article>
<article class="feature-card">
<h3>Connected workflows</h3>
<p>Provider integrations and Nour require Pro or an applicable trial.</p>
</article>
</div>
</section>
</main>
<footer><p>Built by a fictional team for GitTree Learn. Review one change at a time.</p></footer>
<script type="module" src="site.js"></script>
</body>
</html>index.html — SARA
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitTree Features — course demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="site-header">
<a href="#main">GitTree Features</a>
</header>
<main id="main" tabindex="-1">
<section class="hero" aria-labelledby="hero-title">
<p class="eyebrow">GitTree Learn demo project</p>
<h1 id="hero-title">Review changes with confidence.</h1>
<p id="hero-copy">Choose one change, then check what Git saved.</p>
</section>
<section class="features" aria-labelledby="features-title">
<h2 id="features-title">Follow your work</h2>
<div class="cards">
<article class="feature-card">
<h3>History</h3>
<p>Read commits and branches together.</p>
</article>
<article class="feature-card">
<h3>Changes</h3>
<p>Review the exact content selected for a commit.</p>
</article>
<article class="feature-card">
<h3>Recovery</h3>
<p>Inspect the scope of a recovery point before using it.</p>
</article>
</div>
</section>
<section aria-labelledby="plans-title">
<h2 id="plans-title">Choose the workflow you need</h2>
<div class="cards">
<article class="feature-card">
<h3>Local Git</h3>
<p>Local Git workflows work without signing in.</p>
</article>
<article class="feature-card">
<h3>Connected workflows</h3>
<p>Provider integrations and Nour require Pro or an applicable trial.</p>
</article>
</div>
</section>
</main>
<footer><p>Built by a fictional team for GitTree Learn. Review one change at a time.</p></footer>
<script type="module" src="site.js"></script>
</body>
</html>index.html — 오마르
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitTree Features — course demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="site-header">
<a href="#main">GitTree Features</a>
</header>
<main id="main" tabindex="-1">
<section class="hero" aria-labelledby="hero-title">
<p class="eyebrow">GitTree Learn demo project</p>
<h1 id="hero-title">Understand each saved change.</h1>
<p id="hero-copy">Choose one change, then check what Git saved.</p>
</section>
<section class="features" aria-labelledby="features-title">
<h2 id="features-title">Follow your work</h2>
<div class="cards">
<article class="feature-card">
<h3>History</h3>
<p>Read commits and branches together.</p>
</article>
<article class="feature-card">
<h3>Changes</h3>
<p>Review the exact content selected for a commit.</p>
</article>
<article class="feature-card">
<h3>Recovery</h3>
<p>Inspect the scope of a recovery point before using it.</p>
</article>
</div>
</section>
<section aria-labelledby="plans-title">
<h2 id="plans-title">Choose the workflow you need</h2>
<div class="cards">
<article class="feature-card">
<h3>Local Git</h3>
<p>Local Git workflows work without signing in.</p>
</article>
<article class="feature-card">
<h3>Connected workflows</h3>
<p>Provider integrations and Nour require Pro or an applicable trial.</p>
</article>
</div>
</section>
</main>
<footer><p>Built by a fictional team for GitTree Learn. Review one change at a time.</p></footer>
<script type="module" src="site.js"></script>
</body>
</html>index.html — 해결됨
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitTree Features — course demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="site-header">
<a href="#main">GitTree Features</a>
</header>
<main id="main" tabindex="-1">
<section class="hero" aria-labelledby="hero-title">
<p class="eyebrow">GitTree Learn demo project</p>
<h1 id="hero-title">Review each change with confidence.</h1>
<p id="hero-copy">Choose one change, then check what Git saved.</p>
</section>
<section class="features" aria-labelledby="features-title">
<h2 id="features-title">Follow your work</h2>
<div class="cards">
<article class="feature-card">
<h3>History</h3>
<p>Read commits and branches together.</p>
</article>
<article class="feature-card">
<h3>Changes</h3>
<p>Review the exact content selected for a commit.</p>
</article>
<article class="feature-card">
<h3>Recovery</h3>
<p>Inspect the scope of a recovery point before using it.</p>
</article>
</div>
</section>
<section aria-labelledby="plans-title">
<h2 id="plans-title">Choose the workflow you need</h2>
<div class="cards">
<article class="feature-card">
<h3>Local Git</h3>
<p>Local Git workflows work without signing in.</p>
</article>
<article class="feature-card">
<h3>Connected workflows</h3>
<p>Provider integrations and Nour require Pro or an applicable trial.</p>
</article>
</div>
</section>
</main>
<footer><p>Built by a fictional team for GitTree Learn. Review one change at a time.</p></footer>
<script type="module" src="site.js"></script>
</body>
</html>GitTree에서
Command+Shift+P(Ubuntu에서는 Ctrl+Shift+P)를 사용하여 팔레트를 엽니다. 명명된 분기에 대한 작업은 해당 분기의 오른쪽 클릭 메뉴를 사용합니다.
- 다음 섹션에 표시된 대로 세 개의 복사본을 만듭니다. 각각에서
conflict/sara은(는) 체크아웃되었으며 상태는 비어 있습니다. 중단 사본에 있는conflict/sara의 전체 ID를 기록해 두십시오. - Continue copy. gittree-continue을(를) 엽니다.
conflict/omar을 마우스 오른쪽 버튼으로 클릭하고 Always a merge commit와 함께 Merge conflict/omar into conflict/sara를 선택합니다. 중지됩니다. 배너에서 Resolve을 선택하고,index.html을 열고, Edit Output을 선택하고,Review each change with confidence.를 쓰고 Save and Mark Resolved를 선택합니다. - 충돌이 없는지 확인한 다음 배너에서 Continue을(를) 한 번 선택하세요. 알림에는 '완료'라고 표시됩니다. 배너가 사라집니다. 새 커밋에는 두 개의 부모가 있습니다.
- Abort copy. gittree-abort을 열고 동일한 병합을 시작합니다. 갈등을 해결되지 않은 상태로 두십시오. 배너에서 Abort…를 선택합니다. "작업을 중단하시겠습니까?" 대화 상자 브랜치, 인덱스, 파일은 원래 상태로 돌아가고 삭제된 내용은 먼저 복구 스냅샷에 보관된다고 설명합니다. Abort을 선택하세요. 알림에는 "중단되었습니다. 삭제된 변경 사항은 refs/ogt/trash/...에 보관됩니다. 실행 취소하면 다시 가져옵니다."라고 표시됩니다. (중단이 아무것도 삭제하지 않으면 "중단되었습니다. 저장소가 이전 위치로 돌아왔습니다."라고 표시됩니다.)
- 중단을 확인하세요.
conflict/sara은(는) 여전히 기록해 둔 ID이고 페이지는 Sara의 전체 제목이며 배너가 없습니다. - Skip copy. gittree-skip을(를) 엽니다.
conflict/omar을 마우스 오른쪽 버튼으로 클릭하고 Rebase conflict/sara onto conflict/omar을 선택합니다. 옵션을 꺼진 상태로 두고 Rebase conflict/sara를 선택합니다. 중지됩니다. 이제 배너는 Continue 및 Abort… 옆에 Skip를 제공합니다. 병합 배너에 건너뛰기가 없었습니다. - 재생 중인 커밋(Sara의 커밋)을 읽고 건너뛰면 제목이 생략된다는 점을 인정하고 Skip을 한 번 선택합니다. 알림에는 "단계를 건너뛰었습니다"라고 표시됩니다.
- 건너뛰기를 확인하세요. 페이지에 Omar의 제목이 표시되고, 이제
conflict/sara이 Omar의 커밋을 가리키며 배너가 표시되지 않습니다. 세 가지 결과를 비교하고 따로 보관하세요.
과정의 모든 일반적인 커밋에 대해: Summary는 명시된 주제이고, Description는 비어 있으며, 옵션 Amend Previous Commit, Skip Hooks, Add Signed-off-by, Different Author, Push After Commit 및 Allow Empty Commit는 꺼져 있습니다.
터미널에서
18과 결과의 별도의 깨끗한 사본에서:
git switch --create conflict/sara
BASE_SHA="$(git rev-parse HEAD)"SARA를 index.html(으)로 저장한 후 다음을 수행하세요.
git add -- index.html
git -c user.name="Sara Lindqvist" -c user.email=sara@example.com commit --quiet -m "feat: Sara clarifies the hero"
git switch --quiet --create conflict/omar "$BASE_SHA"OMAR을 index.html로 저장한 후:
git add -- index.html
git -c user.name="Omar Haddad" -c user.email=omar@example.com commit --quiet -m "feat: Omar explains the hero"
git switch --quiet conflict/sara이 상태의 깨끗한 복사본 3개를 만듭니다(gittree-continue, gittree-abort, gittree-skip). 먼저 확실하지 않을 때마다 무엇이 활성화되어 있는지 확인하세요.
git statusContinue copy. 종료 코드 1로 병합이 중지됩니다. RESOLVED를 index.html로 저장한 후 다음을 수행합니다.
git merge --no-ff --no-edit conflict/omar
git add -- index.html
git -c core.editor=true merge --continue
git ls-files --unmerged
git status --short마지막 두 명령은 아무것도 인쇄하지 않습니다. Abort copy:
git rev-parse conflict/sara
git merge --no-edit conflict/omar
git merge --abort
git rev-parse HEAD conflict/sara
git status --short병합이 중지되고 git merge --abort이(가) 종료됩니다. git rev-parse HEAD conflict/sara에 의해 인쇄된 두 ID는 동일합니다. index.html은 Sara의 전체 페이지이고 상태는 비어 있습니다. 중지된 리베이스는 git rebase --abort과 동일한 방식으로 유지됩니다. Skip copy:
git rebase conflict/omar
git rebase --skip
git rev-parse HEAD conflict/omar
git status --short리베이스가 중지됩니다. git rebase --skip는 "성공적으로 리베이스됨"으로 마무리합니다. 두 ID가 동일하므로 Sara의 분기는 이제 Omar의 커밋에 있고 페이지는 Omar의 분기이며 상태는 비어 있습니다. Sara가 건너뛴 커밋은 더 이상 브랜치에 없지만 Git에는 한동안 남아 있습니다(reflog, 29과). 해당 결과를 두 입력을 모두 유지하는 결의안으로 읽지 마십시오.
결과
Where you end: 3개의 사본, 3개의 다른 결과. 계속 사본에는 제목이 결합된 두 상위 병합 커밋이 있습니다. 중단 사본은 Sara의 제목과 함께 정확히 시작된 곳입니다. 스킵 복사본에는 Omar의 커밋에 Omar의 제목과 Sara의 분기가 있습니다. 3건 모두 수술이 끝났으며 상태는 깨끗합니다.
일반적인 실수
- 건너뛰기를 사용하여 충돌을 "지나치기"합니다. 결과에서 해당 커밋의 변경 사항을 삭제합니다.
- 병합 또는 리베이스가 여전히 중지된 상태에서 다른 병합 또는 리베이스를 시작합니다.
git merge --abort또는git rebase --abort대신git reset --hard를 사용하여 이스케이프합니다.- 한 번의 클릭으로 완료되면 중단되고, 무엇이 준비되었는지 확실하지 않으면 계속됩니다.
뭔가 잘못되면
길을 잃었다면 배너나 git status을(를) 먼저 읽고 다시 결정하세요. 중단은 항상 시작으로 돌아가는 안전한 방법입니다. 실수로 건너뛴 경우 맹목적으로 다시 시작하지 마세요. 건너뛴 커밋은 리플로그에서 한동안 도달할 수 있으며(레슨 29) 레슨 30에서는 GitTree의 Undo로 되돌릴 수 있는 내용을 보여줍니다.
이해도를 확인해보세요
각 질문에 답한 후 그 이유를 읽어보세요. '필수'라고 표시된 질문은 수업 완료에 반영됩니다.
6개 중 0개 정답
수업을 완료하려면 필수 질문에 올바르게 답하세요.
이 브라우저에서 확인했습니다.
연습
각 복사본에서 작업, 선택 및 증명을 명시합니다. 계속하려면 두 부모와 병합되지 않은 빈 목록을, 동일한 ID와 Sara의 페이지를 중단하려면, Omar의 페이지와 커밋의 분기를 건너뛰세요. 그런 다음 병합에 건너뛰기가 제공되지 않는 이유를 예측하세요.
귀하의 확인: 사이트에서 귀하의 컴퓨터를 볼 수 없습니다.
수업을 완료하려면 필수 질문에 올바르게 답하고 실제 연습을 확인하세요.
요약
- 행동하기 전에 무엇이 활성화되어 있는지 알아보세요.
- 해결 후 계속하고, 커밋을 남기려면 건너뛰고, 돌아가려면 중단하세요.
- 이후 커밋, 파일 및 상태를 확인하세요.
관련된
용어집 소개
계속 — متابعة; 건너뛰기 - تاتاتّي; 중단하다 - إيقاب; 작동 — عملية.
비디오 대본
영상의 나레이션, 큐별로.
성적표 표시
- 병합 또는 리베이스가 중지됩니다. 당신은 세 가지가 있습니다 탈출구.
- 계속하면 끝납니다. 건너뛰기 1개 커밋하다. 중단이 돌아갑니다.
- 먼저, 항상 어떤 작업이 활동적입니다.
- 배너에 이름이 지정됩니다. 터미널에서 git 상태는 그렇습니다.
- 사라와 오마르의 가지를 건설하고 세 개의 동일한 사본.
- 같은 시작, 세 가지 다른 결말.
- 하나 복사: 계속합니다. 병합을 시작하고, 그리고 그것은 멈춘다.
- 해결하고, 파일을 열고, 결합된 제목.
- 저장하고 해결됨으로 표시하면 Git이 볼 수 있습니다. 파일을 완료했습니다.
- 이제 계속을 사용할 수 있습니다. 한번 선택해 보세요.
- 완료. 새 커밋에는 두 개의 상위 커밋이 있으며 배너가 사라졌습니다.
- 2개 복사: 중단합니다. 동일한 병합을 시작하십시오.
- 갈등은 그대로 두고 선택하라 중단합니다.
- 대화상자에서는 무엇이 돌아오는지 설명하고 가장 먼저 지켜지는 것.
- 저장소가 원래 위치로 돌아왔습니다. 전에.
- 브랜치 팁은 동일한 ID이고 페이지는 다시 Sara의 페이지입니다.
- 3개 복사: 건너뜁니다. 이것은 리베이스입니다.
- Sara의 브랜치를 Omar의 브랜치로 리베이스합니다. 멈춰요 갈등으로.
- 이제 배너에 건너뛰기 버튼이 있습니다. 병합 한 번도 없었습니다.
- Skip은 Sara의 커밋을 제외합니다. 결과. 큰 소리로 말해보세요.
- 한 번 건너뛰기를 선택합니다.
- 페이지에는 Omar의 제목이 표시됩니다. 사라의 이제 지점이 커밋을 진행하고 있습니다.
- 건너뛰기는 해결 방법이 아닙니다. 삭제되었습니다 이 결과로 인한 Sara의 변화.
- 터미널에서 git status는 무엇인지 보여줍니다. 활성 및 명령.
- 병합: 해결된 파일을 추가한 다음 git 계속 병합하세요.
- 중단: 분기 끝이 동일합니다. 전후.
- 건너뛰기: git rebase 건너뛰기 및 분기 Omar의 커밋에 참여합니다.
- 모든 사본에서 상태는 비어 있으며 병합되지 않은 것은 아무것도 없습니다.
- 입력 변경: 파일을 해석한 다음 대신 중단을 선택하십시오.
- 귀하의 결심은 다음과 같이 삭제됩니다. 복구 스냅샷이 저장되었습니다.
- 탈출하기 위해 재설정을 사용하지 마십시오. 중단은 안전한 탈출구.
- 실수로 건너뛴 경우 커밋은 다음과 같습니다. 아직도 리플로그에 있어요.
- 연습: 작업 이름, 선택 항목, 그리고 각 사본에 대한 증거.
- 다음으로 단일 커밋을 다른 커밋에 복사합니다. 체리픽이 있는 가지.