깃 워크트리란 무엇이고, 왜 사용해야 할까요?

발행: (2026년 6월 17일 AM 05:58 GMT+9)
9 분 소요

출처: GitHub 블로그

It seems like the latest hotness in git these days is the concept of worktrees. Which… is kind of funny because they’ve been around since 2015.

하지만, 그래도他们很酷,并且您可能会好奇为什么使用它们、它们与分支有何不同以及它们为何突然如此流行。

Let’s talk about it!

브랜치와 스태시로 컨텍스트 전환

Let’s say you lived in a worktree‑less world, and were working on a ticket, and suddenly an urgent bug came to you and you had to switch contexts.

가정해 봅시다. 워크트리 없는 세상에서 티켓을 진행 중이었고, 갑자기 급한 버그가 와서 컨텍스트를 바꿔야 했던 상황입니다.

First, you might stash your work:

git stash "wip feature login" 

Then you’d switch to your main branch and update:

git checkout main 
git pull origin main

Then make a bugfix branch:

git checkout -b hotfix-bug

Then you’d fix everything, commit, and push the branch:

git add . 
git commit -m "fix broken submit button" 
git push origin hotfix-bug

You merge the pull request online just like before, and once it’s merged, you might return back to your computer and pull main and remove the bug branch:

git checkout main 
git pull origin main 
git branch -d hotfix-bug 

And then you could go back to the feature you were working on:

git checkout feature-login 
git stash pop

Phew. Where were we?

컨텍스트 전환 부담은 매우 무겁고, 파일을 재로드하고 node_modules를 변경에 따라 다시 설치하는 등의 정신적 부하가 큽니다.

Now, this is a basic example, but sometimes developers would work around this kind of chaos with doing some more complicated git stash commands, or even multiple clones of the same repo (I’m guilty of that one).

Until… worktrees!

워크트리로 컨텍스트 전환

With worktrees, you never leave your branch and you never stash, and your editor context for your original feature stays untouched.

git worktree add ../hotfix-workspace -b hotfix-bug main

Now you can open that folder in a new editor window (or cd into it) and fix the bug. Your original editor window stays exactly as you left it.

cd  ../hotfix-workspace 
#  ...fix fix fix... 
git add . 
git commit -m "fix broken submit button" 
git push origin hotfix-bug

You merge the pull request online just like before, and once it’s merged, you can simply delete the temporary folder.

cd  ../main-project 
git worktree remove  ../hotfix-workspace

This is so much smoother! There’s zero risk of stash conflicts, there’s no editor disruption, and you can truly work in parallel.

왜 이제야?

For a really long time, worktrees were relatively unknown. Most developers had never heard of them, because either Git GUIs didn’t support them (or treated them as second‑class citizens), or because they just usually followed the known pattern of feature branch → work → PR → merge → repeat.

워크트리는 아주 오랜 시간 동안 상대적으로 알려지지 않았습니다. 대부분 개발자는 워크트리를 들어본 적이 없으며, Git GUI가它们를 지원하지 않거나(또는它们를 2급 시민으로 대했다)거나, 단순히 기능 브랜치를 만든 뒤 작업하고 풀 요청을 한 뒤 머지하고 반복하는 일반적인 패턴을 따랐기 때문입니다.

Now, our work as developers has changed. AI has made us work in parallel more than we ever have before in the history of software development. Developers run so many sessions in parallel, and “code review culture” is growing beyond “code writing culture.”

에이전트와 인간은 워크트리로 더 많은 병렬 작업을 수행할 수 있습니다. 이는 GitHub Copilot 앱의 기본 모드이며, 많은 다른 현대 도구에서도 기본 모드입니다.

주의할 점은?

Worktrees do solve a whole lot of issues, but there’s definitely some things to watch out for.

  • 의존성 과잉: 각 워크트리 폴더는 프로젝트 의존성의 자체 복사본을 필요로 합니다. npm install이나 pip install을 여러 워크트리에서 실행하면 컴퓨터가 금방 가득 차버릴 수 있습니다.

  • 폴더 관리: 워크트리 폴더를 삭제해父目录가 혼잡해지는 것을 방지해야 합니다. GitHub Copilot 앱과 같은 앱은 이를 자동으로 처리하지만, 터미널에서 직접 작업한다면 스스로 삭제해야 할 수도 있습니다.

  • 전역 .gitignore 요구사항: 메인 레포 디렉터리 내에 워크트리 폴더를 만들면 .gitignore에 수동으로 추가해 추적되지 않도록 해야 합니다. 외부 레포에 워크트리를 두는 것이 가능하며(많은 앱이 기본적으로 그렇게 함), 이를 염두에 두는 것이 좋습니다.

  • 한 브랜치 제한: Git은 동일한 브랜치를 두 개의 다른 워크트리에서 동시에 체크아웃하는 것을 방지해 데이터 손상을 예방합니다.

GitHub Copilot 앱에서 워크트리 사용법

Great question! What’s awesome is… they “just work” out of the box.

좋은 질문이에요! 멋진 점은…他们“just work” out of the box.

Then, once you kick off a new session, you can click the session name at the top of the app, and you’ll see the (fun!) generated name of your worktree, as well as the location where it’s located, the project that worktree is for, and details about the changes that you’ve made.

![이전 단계에 생성된 워크트리 스크린샷.](https://github.blob/ wp-content/uploads/2025/06/Universe26-Icon.svg)

Easy peasy lemon squeezy!

워크트리를 사용해야 할까?

가장 선임 개발자답게 답변드리면: 다릅니다! 여러분이 선택한 방식에 따라 다를 수 있으며, 병렬 작업이 적고 브랜치·스태시 모델을 선호할 수도 있고, 앞으로는 워크트리만 사용하기로 할 수도 있으며, 둘 다 활용하고 싶을 수도 있습니다!

The world’s your oyster, and you can try them all in the GitHub Copilot app today.

세상은 여러분의 것입니다, 그리고 오늘 GitHub Copilot 앱에서 모두 시도해 볼 수 있습니다.

	Written by	

		

				
			
				
				![Cassidy Williams](https://avatars.githubusercontent.com/u/1454517?v=4&s=200) 
			
		
			
				
				

Cassidy는 GitHub에서 개발자 옹호 담당 부사장입니다. 그녀는 소프트웨어를 만들고, 스타트업을 조언하며, 개발자들이 더 나은 것을 만들 수 있도록 가르칩니다. 매주 뉴스레터인 cassidoo.co/newsletter에서 업데이트, 코딩 문제 연습, 그리고 이메일에 농담을 받을 수 있습니다!

	Explore more from GitHub	

	
	

![문서](https://github.blob/ wp-content/ uploads/2024/07/Icon-Circle.svg)

	 Docs		
	 GitHub를 완벽하게 마스터할 수 있는 모든 것을 한 곳에 제공합니다.

				
			
				Go to Docs											
								
		
		

	

![GitHub](https://github.blob/ wp-content/uploads/2024/07/recirculation-github-icon.svg)

	 GitHub		
	 GitHub에서 다음을 만들고 싶다면, 어디서든 무엇을든 만들 수 있는 곳입니다.

				
			
				Start building											
								
		
		

	

![Customer stories](https://github.blob/ wp-content/uploads/2024/07/Icon_da43dc.svg)

	 Customer stories		
	 GitHub와 함께 구축하는 기업과 엔지니어링 팀들을 만나보세요.

				
			
				Learn more											
								
		
		

	

![GitHub Universe 2026](https://github.blob/ wp-content/uploads/2025/06/Universe26-Icon.svg)

	 GitHub Universe 2026		
	 10월 28~29일 샌프란시스코에서 또는 온라인으로 GitHub Universe에 참여하세요. 이는 전 세계 개발자를 모으는 주요 행사입니다.

				
			
				Register now
0 조회
Back to Blog

관련 글

더 보기 »