0
我想知道這兩個git
命令是完全一樣的嗎?「git clone -b name url」與「git clone url --branch name」是一樣的嗎?
git clone git://git.yoctoproject.org/poky --branch daisy
git clone -b daisy git://git.yoctoproject.org/poky.git
我想知道這兩個git
命令是完全一樣的嗎?「git clone -b name url」與「git clone url --branch name」是一樣的嗎?
git clone git://git.yoctoproject.org/poky --branch daisy
git clone -b daisy git://git.yoctoproject.org/poky.git
據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://
)並且參數順序無關緊要。