Mr Stinky
Mr Stinky

Reputation: 891

EGit push to remote is opposite what I expect it to do

This is what I want to do:

This is what I see:

Let me give an example and maybe someone can tell me where I have gone wrong.

After first local commit

Push window

Reversed patches

It's showing that the .project file needs to be removed (instead of being added), and that the change to the readme.txt file should be the reverse of the change I just made:

    @@ -1 +1 @@
    -Goodbye World!
    +Hello World!

The C:\GIT\remote\readme.txt file contains the string "Hello World!". The staged patch doesn't even make sense according to the contents of the file.

I am puzzled.

Upvotes: 1

Views: 61

Answers (1)

Robin Green
Robin Green

Reputation: 33063

No, those are the staged changes on remote. Not the commit history (the git log). Those are two different things.

The "Git GUI" is showing you the changes that you would need to commit directly to the remote repository to bring it into sync with the remote repository's working directory, which is still in the old state - out of date.

To avoid this confusion, developers often make the remote repository a bare repository - one with no working directory. Then it can only be pushed to and pulled from - not committed to directly.

Upvotes: 2

Related Questions