前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Unity团队开发-Git命令行Unity团队开发-Git命令行

Unity团队开发-Git命令行Unity团队开发-Git命令行

作者头像
孙寅
发布2021-12-07 13:17:32
7220
发布2021-12-07 13:17:32
举报
文章被收录于专栏:宜达数字
代码语言:javascript
复制
Administrator@XTKJ-20210419KS MINGW64 ~
$ cd /d/LocalGit

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -a
./  ../  .git/  1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ touch .ignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -a
./  ../  .git/  .ignore  1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -s
total 1
1 1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ remove .ignore
bash: remove: command not found

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -a
./  ../  .git/  .ignore  1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm --cached .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm --cache .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm --cache .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .ignore

nothing added to commit but untracked files present (use "git add" to track)

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .ignore
fatal: pathspec '.ignore' did not match any files

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git add .

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   .ignore


Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .ignore
rm '.ignore'

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -l
total 1
-rw-r--r-- 1 Administrator 197121 6 Nov  3 19:46 1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ ls -a
./  ../  .git/  1.txt

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ touch .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .
./          ../         .git/       .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore

nothing added to commit but untracked files present (use "git add" to track)

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .gitignore

[1]+  Stopped                 vim .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .gitignore

[2]+  Stopped                 vim .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore
        .gitignore.swo
        .gitignore.swp

nothing added to commit but untracked files present (use "git add" to track)

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git add .
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   .gitignore
        new file:   .gitignore.swo
        new file:   .gitignore.swp

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .gitignore.swo
rm '.gitignore.swo'

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git rm -f .gitignore.swp
rm '.gitignore.swp'

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   .gitignore


Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ vim .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git checkout -b dev
fatal: A branch named 'dev' already exists.

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git checkout -b dev
fatal: A branch named 'dev' already exists.

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git checkout dev
Switched to branch 'dev'
A       .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (dev)
$ git checkout master
Switched to branch 'master'
A       .gitignore

Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ git merge dev
Already up to date.


Administrator@XTKJ-20210419KS MINGW64 /d/LocalGit (master)
$ cd ../

Administrator@XTKJ-20210419KS MINGW64 /d
$ cd /d/superGit

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ git clone https://gitee.com/linfenpipi/project-git.git
Cloning into 'project-git'...
info: detecting host provider for 'https://gitee.com/'...
info: detecting host provider for 'https://gitee.com/'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 4.17 KiB | 4.17 MiB/s, done.

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ ssh-keygen -t ed25519 -C "sunyin@f3dt.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_ed25519):
Created directory '/c/Users/Administrator/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_ed25519
Your public key has been saved in /c/Users/Administrator/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:2r4/W9YHzr6nq3ntZagyCZbgcWlPHHnw3jxUQlQyJt0 sunyin@f3dt.com
The key's randomart image is:
+--[ED25519 256]--+
|          .o.+Boo|
|          o..o.=E|
|         o o. .  |
|      o + o. +   |
|     . =S+  . =  |
|      .o+ .  + + |
|      .... .o =.+|
|       .  =o +.o+|
|        ooo=+o=*.|
+----[SHA256]-----+

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ ~/.ssh/id_ed25519.pub
/c/Users/Administrator/.ssh/id_ed25519.pub: line 1: ssh-ed25519: command not found

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ cat ~/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBULdFQyl1v2pI5AUOkXbYH3+IM0gOXMnp4jt6zj9Kds sunyin@f3dt.com

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ cat ~/.ssh/id_ed25519
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACAVC3RUMpdb9qSOQFDpF22B9/iDNIDlzJ6eI7es4/SnbAAAAJjF+l0pxfpd
KQAAAAtzc2gtZWQyNTUxOQAAACAVC3RUMpdb9qSOQFDpF22B9/iDNIDlzJ6eI7es4/SnbA
AAAEDBD15mXF8k9xzjEGZUGlXZFcRqpQKnw6f6RPJYNvX8FhULdFQyl1v2pI5AUOkXbYH3
+IM0gOXMnp4jt6zj9KdsAAAAD3N1bnlpbkBmM2R0LmNvbQECAwQFBg==
-----END OPENSSH PRIVATE KEY-----

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ ^C

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ git status
fatal: not a git repository (or any of the parent directories): .git

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ git status
fatal: not a git repository (or any of the parent directories): .git

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ ls -l
total 4
drwxr-xr-x 1 Administrator 197121 0 Nov  5 09:27 project-git/

Administrator@XTKJ-20210419KS MINGW64 /d/superGit
$ cd project-git/

Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        GitTest/

nothing added to commit but untracked files present (use "git add" to track)

Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git add .
warning: LF will be replaced by CRLF in GitTest/Assets/Scenes.meta.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/Assets/Scenes/SampleScene.unity.meta.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/Packages/manifest.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/Packages/packages-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/AudioManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/ClusterInputManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/DynamicsManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/EditorBuildSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/EditorSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/GraphicsSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/InputManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/NavMeshAreas.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/PackageManagerSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/Physics2DSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/PresetManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/ProjectSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/ProjectVersion.txt.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/QualitySettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/TagManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/TimeManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/UnityConnectSettings.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/VFXManager.asset.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in GitTest/ProjectSettings/XRSettings.asset.
The file will have its original line endings in your working directory

Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   GitTest/Assets/Scenes.meta
        new file:   GitTest/Assets/Scenes/SampleScene.unity
        new file:   GitTest/Assets/Scenes/SampleScene.unity.meta
        new file:   GitTest/Packages/manifest.json
        new file:   GitTest/Packages/packages-lock.json
        new file:   GitTest/ProjectSettings/AudioManager.asset
        new file:   GitTest/ProjectSettings/ClusterInputManager.asset
        new file:   GitTest/ProjectSettings/DynamicsManager.asset
        new file:   GitTest/ProjectSettings/EditorBuildSettings.asset
        new file:   GitTest/ProjectSettings/EditorSettings.asset
        new file:   GitTest/ProjectSettings/GraphicsSettings.asset
        new file:   GitTest/ProjectSettings/InputManager.asset
        new file:   GitTest/ProjectSettings/NavMeshAreas.asset
        new file:   GitTest/ProjectSettings/PackageManagerSettings.asset
        new file:   GitTest/ProjectSettings/Physics2DSettings.asset
        new file:   GitTest/ProjectSettings/PresetManager.asset
        new file:   GitTest/ProjectSettings/ProjectSettings.asset
        new file:   GitTest/ProjectSettings/ProjectVersion.txt
        new file:   GitTest/ProjectSettings/QualitySettings.asset
        new file:   GitTest/ProjectSettings/TagManager.asset
        new file:   GitTest/ProjectSettings/TimeManager.asset
        new file:   GitTest/ProjectSettings/UnityConnectSettings.asset
        new file:   GitTest/ProjectSettings/VFXManager.asset
        new file:   GitTest/ProjectSettings/XRSettings.asset

Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git commit -m "项目第一次入git仓库"
[master e76ce83] 项目第一次入git仓库
 24 files changed, 2337 insertions(+)
 create mode 100644 GitTest/Assets/Scenes.meta
 create mode 100644 GitTest/Assets/Scenes/SampleScene.unity
 create mode 100644 GitTest/Assets/Scenes/SampleScene.unity.meta
 create mode 100644 GitTest/Packages/manifest.json
 create mode 100644 GitTest/Packages/packages-lock.json
 create mode 100644 GitTest/ProjectSettings/AudioManager.asset
 create mode 100644 GitTest/ProjectSettings/ClusterInputManager.asset
 create mode 100644 GitTest/ProjectSettings/DynamicsManager.asset
 create mode 100644 GitTest/ProjectSettings/EditorBuildSettings.asset
 create mode 100644 GitTest/ProjectSettings/EditorSettings.asset
 create mode 100644 GitTest/ProjectSettings/GraphicsSettings.asset
 create mode 100644 GitTest/ProjectSettings/InputManager.asset
 create mode 100644 GitTest/ProjectSettings/NavMeshAreas.asset
 create mode 100644 GitTest/ProjectSettings/PackageManagerSettings.asset
 create mode 100644 GitTest/ProjectSettings/Physics2DSettings.asset
 create mode 100644 GitTest/ProjectSettings/PresetManager.asset
 create mode 100644 GitTest/ProjectSettings/ProjectSettings.asset
 create mode 100644 GitTest/ProjectSettings/ProjectVersion.txt
 create mode 100644 GitTest/ProjectSettings/QualitySettings.asset
 create mode 100644 GitTest/ProjectSettings/TagManager.asset
 create mode 100644 GitTest/ProjectSettings/TimeManager.asset
 create mode 100644 GitTest/ProjectSettings/UnityConnectSettings.asset
 create mode 100644 GitTest/ProjectSettings/VFXManager.asset
 create mode 100644 GitTest/ProjectSettings/XRSettings.asset

Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git push
info: detecting host provider for 'https://gitee.com/'...
info: detecting host provider for 'https://gitee.com/'...
Enumerating objects: 32, done.
Counting objects: 100% (32/32), done.
Delta compression using up to 8 threads
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 16.64 KiB | 2.08 MiB/s, done.
Total 31 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.2]
To https://gitee.com/linfenpipi/project-git.git
   7711548..e76ce83  master -> master
Administrator@XTKJ-20210419KS MINGW64 /d/superGit/project-git (master)
$ git pull
info: detecting host provider for 'https://gitee.com/'...
info: detecting host provider for 'https://gitee.com/'...
Already up to date.
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021/11/5 上,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档