Git获取不更新origin / master [英] Git fetch not updating origin/master

查看:889
本文介绍了Git获取不更新origin / master的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行 git fetch 时,即使我可以看到我的 origin / master 后面没有任何反应一个在GitHub上。我从 git fetch 获得的唯一结果是

When I do git fetch, nothing happens, even though I can see that my origin/master is behind the one on GitHub. The only output I get from git fetch is

$ git fetch origin
From github.com:myname/myrepo
 * branch            master      -> FETCH_HEAD

我想要的输出是

The output I want is

$ git fetch
From github.com:myname/myrepo
   6a6a103..77edb9d  master     -> origin/master
 * [new branch]      feature    -> origin/feature

当我运行 git ls-remote

when I run git ls-remote:

$ git ls-remote
From git@github.com:myname/myrepo.git
77edb9d40be3a75bd25288ab375ef16e009267fa        HEAD
77edb9d40be3a75bd25288ab375ef16e009267fa        refs/heads/master      <-- latest
9f2c06129eefef3f1cdc96499058d7b58e2ad0b6        refs/heads/feature

git show-ref 给了我

but git show-ref gives me

$ git show-ref
e4d894a2db19c3dbbdb946b25142c981695e0790 refs/heads/master
9f2c06129eefef3f1cdc96499058d7b58e2ad0b6 refs/heads/feature
6a6a10322110a690044e267eb7644613057dd932 refs/remotes/origin/master    <-- old!

为什么不会执行任何操作 git fetch

Why won't git fetch do anything?

推荐答案


如果有办法通过命令行解决这个问题?

If there is a way to fix this via the command line?

您可以使用 git config 命令(要再次获取所有远程分支机构):

You can use a git config command (to fetch again all remote branches):

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

这篇关于Git获取不更新origin / master的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆