通过 git 日志获得的这张图究竟意味着什么?

How exactly mean this graph obtained by git log?

我完全是GIT的新手,我有以下疑问。

我正在从事的项目中:

Andrea@Andrea-PC MINGW64 ~/Documents/WS_vari/version-control/asteroids (master)
$ git branch
* master

所以应该是我这个项目只有master分支。我的理解正确吗?

然后我想看看与这个项目执行的承诺相关的图表:

git log --graph --oneline --decorate=full --all

这是我的输出:

Andrea@Andrea-PC MINGW64 ~/Documents/WS_vari/version-control/asteroids (master)
$ git log --graph --oneline --decorate=full --all
* cba1887 (HEAD -> refs/heads/master) fixing: fixed the bug related of the weapo
n delay
* 3884eab (refs/remotes/origin/master, refs/remotes/origin/HEAD) Add color
* 3e42136 now using requestAnimationFrame
* 4035769 frame interval was set wrong after game was paused
* 25ede83 a couple missing ends with the ipad version
* df03538 I can't spell 'screen' apparently :)
| * 354dfdd (refs/remotes/origin/coins) Make ships able to spawn on coins
| * 0c6daf1 Make it possible to collect coins
| * a3c0ae4 Create helper functions
| * 656b02e First pass at adding coins
|/
* b0678b1 Revert controls
* f19cb1b Fix typo in space
* 75928a9 Use space for movement and enter for shooting
* ac83b72 mostly finished ipad version
* 7ca4826 trying to get div touch controls to work

....................................................................
....................................................................
....................................................................

所以我认为这意味着:

1) 最后一次提交有 id cba1887 并且这次提交进入 master 分支。

我的问题在图表的这一部分:

* df03538 I can't spell 'screen' apparently :)
| * 354dfdd (refs/remotes/origin/coins) Make ships able to spawn on coins
| * 0c6daf1 Make it possible to collect coins
| * a3c0ae4 Create helper functions
| * 656b02e First pass at adding coins
|/

所以在我看来,它正在创建一个新的分支,其 ID 为 df03538(该分支可以有一个 ID 或者我是否遗漏了什么?)和标签 我显然不会拼写 'screen' :).

此分支包含 4 个提交,id 为 354dfdd、0c6daf1、a3c0ae4、656b02e

是我的解释正确还是我遗漏了什么?

如果我的解释是正确的,并且这是一个新分支,为什么我看不到它进入之前 git 分支 语句获得的分支列表只显示 master 分支?

Is it my interpretation correct or am I missing something?

不,行 * df03538 I can't spell 'screen' apparently :) 是一个单元,表示在您的 master 分支中提交。

同时,* 354dfdd (refs/remotes/origin/coins) Make ships able to spawn on coins 是您所说的分支的最后一次提交。

why I can't see it into the list of branches obtained by the previous git branch statement that show only the master branch?

这里refs/remotes/origin/coins作为唯一的ref意味着它是一个远程分支,你还没有在本地签出,你可以通过以下方式实际看到它:

git branch -a

而且,您可以通过以下方式查看:

git checkout -t origin/coins

这将创建一个名为 coins 的本地分支,该分支还跟踪 origin/coins,您可以通过 git branch.

查看它