为什么 git fetch 没有下载任何东西?

Why git fetch doesn't download anything?

我正在尝试下载我的项目,该项目已上传到我的本地目录中的 bitbucket。据我所知 git fetch,它应该下载项目 (但不是 merge

好吧,我也连接到我的存储库,这是我所做的:

这是 git fetch 的结果:(如上图所示)

$ git fetch
remote: Counting objects: 114, done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 114 (delta 6), reused 114 (delta 6)
Receiving objects: 100% (114/114), 10.32 MiB | 2.03 MiB/s, done.
Resolving deltas: 100% (6/6), done.
From https://bitbucket.org/lamtakam/lamtakam
 * [new branch]      master     -> origin/master

但是没有下载..!为什么?如您所见,我的本地目录是空的 .git 文件夹除外)。怎么了?

git fetch 只需用打包数据更新您的 .git 文件夹。
它不会仅更新您的工作目录内部 .git 文件夹。

下载所有数据后,您可以签出要处理的任何分支。

git fetch

The git fetch command imports commits from a remote repository into your local repo (no to be confused with the local working directory).

The resulting commits are stored as remote branches instead of the normal local branches that we’ve been working with. This gives you a chance to review changes before integrating them into your copy of the project.


要查看可用分支列表,请使用 -a 标志

# display all available branches
git branch -a

为了在特定分支上工作,只需检查所需的分支