Git从我的公共存储库拉不工作 [英] Git pull from my public repository not working

查看:128
本文介绍了Git从我的公共存储库拉不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的存储库中的 .git / config 配置文件:

 <$ c $ b $ repositoryformatversion = 0 
filemode = true
bare = false
logallrefupdates = true
[remoteorigin]
url = git@github.com:< username> /< repository> .git
fetch = + refs / heads / *:refs / remotes / origin / *
[user]
name = <用户名>

我在github中正确配置了我的公共ssh密钥。我将更改从另一台机器推送到了这个存储库中,该机器正确更新到github中。

然而,在我当前的机器中,当我发出git pull请求时:

  git pull origin master 

它表示已更新



如果不是这种情况,我的github存储库中的更新文件不在我的本地存储库中。 / p>

我能做什么错?

更新:



我从Olivier Refalo的回答中尝试了以下内容:

在github和本地分支都是master。 p>

输出到命令:

  git for-each-ref  - -format =local:%(refname:short)<  -  sync  - > remote:%(upstream:short)refs / heads 

如下:


local:master< - sync - > remote :





$ b


origin git @@ git remove -v 返回以下输出:

github.com:username/repository.git(fetch)

origin git@github.com:username / repository.git(推送)


解决方案

我没有发现问题所在,所以我做了一个github的新git克隆以获得更新的文件。

This is my .git/config configuration file in my repository:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git@github.com:<username>/<repository>.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[user]
    name = <username>

I have correctly configured my public ssh key in github. I pushed my changes into this repository from another machine, which where correctly updated into github.

However in my current machine, when I make a git pull request:

git pull origin master

It says "already up to date"

When it's not the case at all, the updated files in my github repository are not in my local repository.

What can I be doing wrong?

UPDATE:

I've tried the following from the answer from Olivier Refalo:

In github and in local the branches are master.

The output to the command:

git for-each-ref --format="local: %(refname:short) <--sync--> remote: %(upstream:short)" refs/heads

Is the following:

local: master <--sync--> remote:

git remove -v returns the following output:

origin git@github.com:username/repository.git (fetch)

origin git@github.com:username/repository.git (push)

解决方案

I didn't find out what was the problem so what I did was a new git clone from github in order to get the updated files.

这篇关于Git从我的公共存储库拉不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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