简体   繁体   English

Git 在 Amazon EC2 上拉取旧文件

[英]Git pulling older files on Amazon EC2

Been using git for a few months now and this one has me stumped.几个月来一直在使用 git,这个让我很难过。 We have a git repo on AWS EC2.我们在 AWS EC2 上有一个 git 存储库。 Syncing is fine and works right out of the box using gitosis.同步很好,可以使用 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 git 远程显示原点

  • remote origin遥远的起源
    Fetch URL: git@blahblahblah:/Project获取 URL: git@blahblahblah:/Project
    Push URL: git@blahblahblah:/Project推送 URL:git@blahblahblah:/Project
    HEAD branch: master HEAD 分支:master
    Remote branch:远程分支:

    master tracked主跟踪
    Local branch configured for 'git pull':为“git pull”配置的本地分支:
    master merges with remote master master 与远程 master 合并
    Local ref configured for 'git push':为“git push”配置的本地参考:
    master pushes to master (up to date)主推到主(最新)

I work from my own branch, lets say mybranch and merge to the master.我在自己的分支工作,比如说 mybranch 并合并到主分支。 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.奇怪的是服务器上存在最新的文件,因为我可以通过 gitk 看到它们,但它似乎没有提取最新的文件。

Any ideas?有任何想法吗?

If you "git push" a branch to the origin repository you are updating the git repository but not the files on disk.如果您将分支“git push”到原始存储库,则您正在更新 git 存储库,而不是磁盘上的文件。 You need to "git checkout " on the origin (EC2) repository in order to apply the repository to the local files.您需要在源 (EC2) 存储库上“git checkout”,以便将存储库应用于本地文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM