Git 在 Amazon EC2 上拉取旧文件
使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您将一个分支“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.