gpt4 book ai didi

git - 为什么 git fetch 不下载任何东西?

转载 作者:太空狗 更新时间:2023-10-29 13:52:52 26 4
gpt4 key购买 nike

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

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

enter image description here

这是 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 文件夹。

一旦下载了所有数据,您就可以 checkout 要处理的任何分支。

git 获取

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

enter image description here

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

enter image description here

关于git - 为什么 git fetch 不下载任何东西?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41779529/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com