我想知道这两个git
命令是否完全相同?
git clone git://git.yoctoproject.org/poky --branch daisy
git clone -b daisy git://git.yoctoproject.org/poky.git
答案 0 :(得分:1)
根据git手册页,theese命令是相同的:
$ git help clone
....
--branch <name>, -b <name>
Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare
repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting
repository.
....
正如您所看到的,-b
和--branch
只是同义词。缺少扩展.git
(在第一种情况下)是自动确定的(考虑到协议git://
)并且参数的顺序无关紧要。