GitHub区域理解

版权声明:找不到大腿的时候,让自己变成大腿. https://blog.csdn.net/Xin_101/article/details/88598750

1 Github三个区域

1.0 工作区(working directory)

本地的GitHub仓库,如:

|-- ipynb_test
|   |-- .git
|   |-- tensorflow_model.ipynb
|   `-- tensorflow_variable.ipynb

1.2 版本库(repository)

工作区的目录.gitGithub的版本库,内容如下:

.
|-- COMMIT_EDITMSG
|-- FETCH_HEAD
|-- HEAD
|-- branches
|-- config
|-- description
|-- hooks
|   |-- applypatch-msg.sample
|   |-- commit-msg.sample
|   |-- fsmonitor-watchman.sample
|   |-- post-update.sample
|   |-- pre-applypatch.sample
|   |-- pre-commit.sample
|   |-- pre-push.sample
|   |-- pre-rebase.sample
|   |-- pre-receive.sample
|   |-- prepare-commit-msg.sample
|   `-- update.sample
|-- index
|-- info
|   `-- exclude
|-- logs
|   |-- HEAD
|   `-- refs
|       |-- heads
|       |   `-- master
|       `-- remotes
|           `-- origin
|               `-- master
|-- objects
|   |-- 08
|   |   `-- a9db5b82b16aa84c23b3a5d13c6cb8a18a878f
|   |-- 22
|   |   `-- d5967453c05b6fd790d4195863a52f66277ba8
|   |-- 2d
|   |   `-- 1152616a4a53100c326892dd6b717ab80003a6
|   |-- 6f
|   |   `-- 16a024fc373395fa462eb21f75657bd48f7719
|   |-- ad
|   |   `-- 884187d81b00a286025f8e3477b30d4c0ef62e
|   |-- fa
|   |   `-- b51f4c2e37d424cf0e4b7ecaf2de3753ccc1cb
|   |-- info
|   `-- pack
`-- refs
    |-- heads
    |   `-- master
    |-- remotes
    |   `-- origin
    |       `-- master
    `-- tags

22 directories, 29 files

其中,Git会自动创建一个master分支和HEAD文件,该文件是指向master的指针,内容为ref: refs/heads/master.
git commit -m提交的信息会存储在版本库中,并将code上传至云端.

1.3 缓存区(cache)

缓存区用于存储Git的更新,即git add提交的变更都存储在缓存区,在.git文件中为index.

2 Git上传流程

工作区 缓存区 版本库 GitHub Repository git add git commit -m "description" update and saved GitHub 完成一次更新. 工作区 缓存区 版本库 GitHub Repository

[参考文献]
[1]https://blog.csdn.net/u010255818/article/details/50738884
[2]https://www.cnblogs.com/tracylxy/p/6429482.html


猜你喜欢

转载自blog.csdn.net/Xin_101/article/details/88598750