상세 컨텐츠

본문 제목

깃으로 협업하기 기초 -1

Git

by hyunjunstar 2026. 3. 20. 20:39

본문

깃허브 레포지토리 생성

1. github 홈페이지 접속 > New 클릭

2. 이름설정 > 레포지토리 공개 설정(Public) > Create repository > 레포지토리 주소 복사

3. 연습 폴더 생성 > 연습 폴더 주소창에 cmd > "git clone 레포지토리 주소" 명령어 실행("" 빼고)

로컬 레포지토리 = .git 폴더가 있는곳


.gitignore .gitattributes 파일 생성

.git폴더에는 (.git .gitignore .gitattributes 세개의 파일 + .uproject 총 4개의 파일은 한 곳에 있어야 함)

.gitignore

.gitignore 파일은 협업 시 충돌 방지 및 용량 폭발 방지 등 여러 의미를 가진 파일이며 반드시 생성 후 설정해야함

1. .git 폴더가 있는 폴더에 .gitignore생성(메모장 만들기 후 이름 변경)

2. 메모장으로 열기 후 아래 코드 붙여넣고 저장

# Visual Studio 2022 user specific files
.vs/
.vsconfig

# Jetbrain Rider
.idea/

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.ipa
Output
Engine/x64
Client/x64
.vs

# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb

# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga

# Binary Files
Binaries/*
Plugins/**/Binaries/*

# Builds
Build/*

# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/
Build/*/**
!Build/*/PakBlacklist*.txt

# Don't ignore icon files in Build
!Build/**/*.ico

# Built data for maps
*_BuiltData.uasset

# Configuration files generated by the Editor
Saved/*

# Compiled source files for the engine to use
Intermediate/*
Plugins/**/Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*

# Prerequisites
*.d

.gitattributes

.gitattributes(LFS)를 사용하는 이유는 언리얼 대용량 및 바이너리 파일을 안정적으로 관리하기 위해서 꼭 설정해야함

1. .git 폴더가 있는 폴더 주소창에 cmd

2. git lfs install 명령어 실행

3. 연습 폴더에 생성된 .gitattributes 파일을 메모장으로 열기

4. 내용 다 지우고 아래 코드로 붙여넣기 후 저장

# UE file types
*.uasset filter=lfs diff=lfs merge=lfs -text
*.umap filter=lfs diff=lfs merge=lfs -text
# Visual Studio
*.vcxproj filter=lfs diff=lfs merge=lfs -text
# Binaries
*.exe filter=lfs diff=lfs merge=lfs -text
*.dll filter=lfs diff=lfs merge=lfs -text
*.rcc filter=lfs diff=lfs merge=lfs -text
# Contents
*.bank filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.flac filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.icns filter=lfs diff=lfs merge=lfs -text
*.bk2 filter=lfs diff=lfs merge=lfs -text
*.txt filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text

SourceTree 로컬 레포지토리 폴더 추가 및 커밋, 푸시

폴더 추가

1. 소스트리 실행

2. 상단에 +(New Tab)

3. Add(추가) 클릭

4. 연습 폴더 선택(.git 폴더가 보이는 곳에서 폴더 선택) 후 Add(추가) 클릭

커밋, 푸시

1. File Status(파일 상태) 클릭

2. 커밋하는 파일 내용 작성

3. Commit(커밋) 클릭

4. History에 커밋된 내용 확인 후 Push > 

5. 로컬 브랜치와 리모트 브랜치가 맞는지 확인 후 Push 클릭


언리얼 프로젝트 생성

1. 언리얼 프로젝트 GAMES > Blank > C++, Desktop, Scaleble 로 설정 후 생성 (폴더는 아무곳이나 상관 없음) 

2. 생성된 폴더로 들어가서 Config, Content, Source, .uproject 네개 복사후 로컬 레포지토리 폴더에 붙여넣기(.git 폴더가 있는곳)

3. .uproject 파일에 Shift+우클릭

4. Generate Visual Studio files 클리ㄱ

5. .sln 및 여러 파일이 생성된 것 확인

6. .sln 파일 실행 후 빌드

7. 문제없이 잘 작동되면 빌드 종료( ★ 언리얼 엔진 종료 ★ )

8. SourceTree에서 새로고침 후 커밋, 푸시( 언리얼 실행 중 커밋 절대 금지 )

'Git' 카테고리의 다른 글

깃으로 협업하기 기초 -2  (0) 2026.03.24

관련글 더보기