Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Indexed changes in origin after push
Indexed changes in origin after push [message #900717] Wed, 08 August 2012 09:44 Go to next message
Eugene Kondrashev is currently offline Eugene KondrashevFriend
Messages: 8
Registered: January 2012
Junior Member
Hi all

I'm experiencing some unexpected behavior while pushing commits to the origin repo.

Steps:
Clone a git project from local file system
Make some change and commit
Push to the origin newly created commit
See "git status" on remote repository

Actual:
I can see my commit after the push operation, but there are indexed changes which are actually correspond to the state of the code before pushing.

Am I missing something, or is it a bug?

Thanks,
Eugene

[Updated on: Wed, 08 August 2012 09:44]

Report message to a moderator

Re: Indexed changes in origin after push [message #900752 is a reply to message #900717] Wed, 08 August 2012 11:57 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
Sounds like you're pushing to a non-bare repository, which is not the standard pattern.

Keep in mind that push does nothing to the index or working tree of the destination. All it does is copy the commits and update references. If you want to update the index and/or working tree you'll have to do that manually, for instance with a mixed or hard reset.

Better to use a bare repository as the origin, which by definition has no index or working tree and which therefore won't exhibit this behavior.

In circumstances when you need to you move commits directly between two non-bare repositories, rather than going through a common bare origin, use pull rather than push. Or try git bundles for this (though not with Egit/JGit which doesn't support this very useful feature).





Re: Indexed changes in origin after push [message #900809 is a reply to message #900752] Wed, 08 August 2012 14:34 Go to previous message
Eugene Kondrashev is currently offline Eugene KondrashevFriend
Messages: 8
Registered: January 2012
Junior Member
Thanks, that was helpful!

Another question,

how can I catch push event?

I mean, when I click push at synchronization view, is there a possibility to catch that event?

It something similar to onIndexChange event but for the remote repository.
Previous Topic:Add Existing Local Repository programmatically
Next Topic:Commit causes lengthy reindexing of repository
Goto Forum:
  


Current Time: Thu Apr 18 08:06:43 GMT 2024

Powered by FUDForum. Page generated in 0.01755 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top