Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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?

like image 883
Mitch Avatar asked Dec 19 '25 00:12

Mitch


1 Answers

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.

like image 171
Jeff Ferland Avatar answered Dec 21 '25 22:12

Jeff Ferland