PHP Laravel NGINX Symfony Dubbo Bootstrap Python Symfony Apache Protobuf linux Spring Django ASP Thrift Slim Typescript Docker Homestead MySQL Redis Git SVN ssh Root vim java scala sass less PHP Avro android html Golang Vue Angular React NGINX kotlin Rust Javascript

git checkout 中 -- 符号的含义

原创
分类:

原创不易 ~ 喜欢请点我关注

摘自官方文档

https://git-scm.com/docs/git-checkout#_argument_disambiguation
When there is only one argument given and it is not -- (e.g. git checkout abc), and when the argument is both a valid (e.g. a branch abc exists) and a valid (e.g. a file or a directory whose name is "abc" exists), Git would usually ask you to disambiguate. Because checking out a branch is so common an operation, however, git checkout abc takes "abc" as a in such a situation. Use git checkout -- if you want to checkout these paths out of the index.

--表示后续的名称为文件名称,而非branch名称,所以git checkout -- filename不会产生歧义。


正在加载验证码......
请先完成验证