Git-Unity项目版本管理

本文记录如何用git对unity 项目进行版本管理,并可传至GitHub远端。

准备

名称 版本
windows 11
Unity 2202.3.9.f1
git N.A.
github N.A.

GitHub新建项目并添加ssh密钥

  1. GitHub新建一个repository
  2. windows11 生成ssh-key(可选)
ssh-keygen -t rsa
cd ~/.ssh
dir
cat id_rsa.pub

在这里插入图片描述
3. 复制 id_rsa.pub 内容至 repository 的 Setting 下的 Deploy keys 处
在这里插入图片描述

Unity文件夹

为Unity project文件夹配置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 <git@github.com:xxx/xxx.git>
git push -u origin master #上传至branch: master,可根据需要换至其他branch
git status
git log

在这里插入图片描述

参考:
https://unityatscale.com/unity-version-control-guide/how-to-setup-unity-project-on-github/

相关推荐

  1. git版本管理

    2024-07-11 03:40:02       61 阅读
  2. git版本管理工具

    2024-07-11 03:40:02       29 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-11 03:40:02       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-11 03:40:02       71 阅读
  3. 在Django里面运行非项目文件

    2024-07-11 03:40:02       58 阅读
  4. Python语言-面向对象

    2024-07-11 03:40:02       69 阅读

热门阅读

  1. React@16.x(54)Redux@4.x(3)- reducer

    2024-07-11 03:40:02       25 阅读
  2. Linux 安装 docker-compose

    2024-07-11 03:40:02       20 阅读
  3. PostgreSQL

    2024-07-11 03:40:02       20 阅读
  4. Perl词法切分器:文本解析的瑞士军刀

    2024-07-11 03:40:02       18 阅读
  5. 解决Spring Boot中的安全漏洞与防护策略

    2024-07-11 03:40:02       20 阅读
  6. 二、Python日志系统之watchDog监控日志

    2024-07-11 03:40:02       22 阅读
  7. 如何预防SQL注入

    2024-07-11 03:40:02       21 阅读
  8. 1、预处理

    2024-07-11 03:40:02       22 阅读