简体   繁体   中英

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). I can pull from A fine and see changes in those files on 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. On the A machine, git status says that those files have been deleted.

How come I never see the pushed files and why does git think they were deleted?

Roll your working directory forward on A. A push is like a fetch done backwards, not like a pull done backwards. It doesn't affect the working directory.

git checkout $YOUR_BRANCH

Do that on machine A after pushing from B.

See question Why won't I see changes in the remote repo after "git push"? in "Unexpected behaviour" section in GitFaq page on Git Wiki.

If it was apparently successful then it would be apparent that there was success. However, it seems like you apparently are having issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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