📚 [Git] 디렉토리만 pull 하기

Category: Git | 📅 February 14, 2026

git을 쓰면서 디렉토리만 pull 을 할 수 없을까? 매번고민했는데 명령어가 있었구나..

(역시 사람은 배워야… ㅋ)

1. 원하는 디렉토리만 pull 하기

준비물

  1. git
  2. 당연하게도 clone 은 전체를 해야함
  3. 명령어 : git sparse-checkout ( git 2.25+ 버전)

pull하기


git clone <repo-url>
cd <repo-name>
git sparse-checkout init
git sparse-checkout set path/to/directory

2. 원하는 디렉토리만 push 하기

준비물

1번에서 수행된 디렉토리 및 clone 된 repo .

push 하기

git add path/to/directory
git commit -m "Update specific directory"
git push

💭 Reviews
  • push 방법은 뭔가 좀 얄팍? 하지만 ㅋ 잘 써먹으면 좋음
  • 🏷️ Tags
  • #git  
  • #git pull