简体   繁体   English

在显然成功的git推送之后,该文件不在目标上

[英]After apparently successful git push, the file are not on the target

I am setting up git between two AWS instances (call them A and B). 我在两个AWS实例之间设置git(称为A和B)。 I can pull from A fine and see changes in those files on B. 我可以从罚款中获取并查看B上这些文件的更改。

If I create a new file on B and commit it, when I push from B to A, all seems to go well (I get the git message about writing objects...done) but I don't see the files on the A machine. 如果我在B上创建一个新文件并提交它,当我从B推送到A时,一切似乎都顺利(我得到关于编写对象的git消息...已完成)但是我没有看到A上的文件机。 On the A machine, git status says that those files have been deleted. 在A机器上,git status表示这些文件已被删除。

How come I never see the pushed files and why does git think they were deleted? 为什么我从来没有看到推送文件,为什么git认为它们被删除了?

Roll your working directory forward on A. A push is like a fetch done backwards, not like a pull done backwards. 在A上向前滚动工作目录。推送就像向后移动一样,而不是向后拉。 It doesn't affect the working directory. 它不会影响工作目录。

git checkout $YOUR_BRANCH

Do that on machine A after pushing from B. 从B推后,在机器A上执行此操作。

See question Why won't I see changes in the remote repo after "git push"? 看问题为什么我不会在“git push”之后看到远程仓库中的变化? in "Unexpected behaviour" section in GitFaq page on Git Wiki. 在Git Wiki的GitFaq页面的“意外行为”部分。

If it was apparently successful then it would be apparent that there was success. 如果它显然是成功的,那么显然会有成功。 However, it seems like you apparently are having issues. 但是,您似乎显然遇到了问题。

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

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