Git fetch origin vs git fetch --all
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36630490/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git fetch origin vs git fetch --all
提问by Tony Scialo
What is the difference between the following git commands?
以下git命令有什么区别?
git fetch origin
and
和
git fetch --all
Running them from the command line looks like they do the same thing.
从命令行运行它们看起来它们做同样的事情。
回答by Matias Elorriaga
git fetch origin
fetch data only from origin
, and git fetch --all
fetch data from all remotes (origin
is one of them)
git fetch origin
仅从 获取数据origin
,并git fetch --all
从所有遥控器获取数据(origin
是其中之一)
回答by CodeWizard
git fetch --all
--all
Fetch all remotes.
--all
获取所有遥控器。
If you want to get all the data and on the same time also to remove the
deleted data add the --prune
flag
如果您想获取所有数据并同时删除
已删除的数据,请添加--prune
标志
# Fetch all data, remove dangling objects and pack you repository
git fetch --all --prune=now
回答by isherwood
Your repository may have one remote point known by alias as 'origin', but you may also have other remotes configured. The latter command would fetch from them all.
您的存储库可能有一个名为“origin”的远程点,但您也可能配置了其他远程点。后一个命令将从它们全部获取。
More in the docs for fetch.
fetch 文档中的更多内容。