기술나눔

Git-Unity 프로젝트 버전 관리

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

이 문서에서는 git을 사용하여 다음을 수행하는 방법을 기록합니다.단일성 프로젝트는 버전 관리되며 원격으로 GitHub에 업로드할 수 있습니다.

준비하다

이름버전
창문11
단일성2202.3.9.f1
git
깃허브

깃허브새 프로젝트 생성 및 SSH 키 추가

  1. GitHub에 새 저장소 만들기
  2. windows11에서 SSH 키 생성(선택 사항)
ssh-keygen -t rsa
cd ~/.ssh
dir
cat id_rsa.pub
  • 1
  • 2
  • 3
  • 4

여기에 이미지 설명을 삽입하세요.
3. id_rsa.pub의 내용을 저장소의 설정 아래 배포 키에 복사합니다.
여기에 이미지 설명을 삽입하세요.

단일성폴더

Unity 프로젝트 폴더에 대한 git 구성

git init
添加 .gitignore (此步为重点,可避免上传冗余文件:可直接从此处下载放在文件夹里即可 https://github.com/github/gitignore/blob/main/Unity.gitignore)
添加 .gitattributes (此步为重点,可直接从此处下载放在文件夹里即可 https://github.com/gitattributes/gitattributes/blob/master/Unity.gitattributes)
git add .
git commit -m "自定义备注"
git status 

git remote add origin <[email protected]:xxx/xxx.git>
git push -u origin master #上传至branch: master,可根据需要换至其他branch
git status
git log
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

여기에 이미지 설명을 삽입하세요.

인용하다:
https://unityatscale.com/unity-version-control-guide/github에서-unity-프로젝트-설정-방법/