Git 在 Amazon EC2 上拉取旧文件

发布于 2024-11-29 11:12:55 字数 983 浏览 0 评论 0原文

使用 git 已经几个月了,这个让我难住了。我们在 AWS EC2 上有一个 git 存储库。同步效果很好,并且可以使用 gitosis 开箱即用。我们遇到的唯一问题是,当您拉取时,有时会得到某些文件的旧版本。我的设置是这样的:

[core]

  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
  ignorecase = true

[remote "origin"]

    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@blahblahblah:/Project

[branch "master"]

    remote = origin
    merge = refs/heads/master

git remote show origin

  • 远程来源
    获取 URL:git@blahblahblah:/Project
    推送网址:git@blahblahblah:/Project
    HEAD 分支:master
    远程分支:

    <块引用>

    主跟踪
    为“git pull”配置的本地分支:
    主站与远程主站合并
    为“git Push”配置的本地引用:
    master 推送到 master(最新)

我在我自己的分支工作,比如说我的分支并合并到主分支。奇怪的是,最新的文件存在于服务器上,因为我可以通过 gitk 查看它们,但它似乎没有提取最新的文件。

有什么想法吗?

Been using git for a few months now and this one has me stumped. We have a git repo on AWS EC2. Syncing is fine and works right out of the box using gitosis. The only issue we have is when you pull you sometimes get an older version of some files. My setup is like this:

[core]

  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
  ignorecase = true

[remote "origin"]

    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@blahblahblah:/Project

[branch "master"]

    remote = origin
    merge = refs/heads/master

git remote show origin

  • remote origin
    Fetch URL: git@blahblahblah:/Project
    Push URL: git@blahblahblah:/Project
    HEAD branch: master
    Remote branch:

    master tracked
    Local branch configured for 'git pull':
    master merges with remote master
    Local ref configured for 'git push':
    master pushes to master (up to date)

I work from my own branch, lets say mybranch and merge to the master. The strange thing is the latest files are present on the server as I can see them through gitk but it does not seem to pull the very latest.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只有影子陪我不离不弃 2024-12-06 11:12:55

如果您将一个分支“git Push”到原始存储库,您将更新 git 存储库,但不会更新磁盘上的文件。您需要在源 (EC2) 存储库上“git checkout”,以便将存储库应用到本地文件。

If you "git push" a branch to the origin repository you are updating the git repository but not the files on disk. You need to "git checkout " on the origin (EC2) repository in order to apply the repository to the local files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文