2

I am new to Git client, and very much confused with its operations. I am quite familiar with other versioning tools like SVN and CVS. I have got Git plug-in installed in STS, and checked out the project spending good amount of time. My operating system is Windows-7, and using Eclipse Git 1.3.0 on STS Eclipse 2.8.1.

Initially I did not know that a 'simple commit operation' does not actually check-in the files to server repository,but had to 'push to upstream'. It was fine as long as there is no conflicts identified, but it is giving big trouble when I want to perform operation like

  1. Revert the local changes
  2. Un do the local commit
  3. Synchronize with Server Repository ( synchronize perspective window does not appear)
  4. Push to Remote doesn't work most of the time

When I say doesn't work, I mean Git throws exception.

Below are the few errors I used to get.

  1. Exception caught during execution of merge command. org.eclipse.jgit.errors.MissingObjectException: Missing commit c6c4fce9e8a0a228ac1d60f4e5549b5adafa638a

  2. Missing unknown c6c4fce9e8a0a228ac1d60f4e5549b5adafa638a

  3. looking up commit

  4. AnyObjectId[c6c4fce9e8a0a228ac1d60f4e5549b5adafa638a]

  5. Exception caught during execution of merge command. org.eclipse.jgit.errors.MissingObjectException:

  6. An internal error occurred during: "Merging with refs/remotes/origin/master"

When ever there is a conflict or issues with commit, I had to some how (hard) reset my workspace, and re do all my work.

I feel many of you would have experienced such kind of issues, and I would like to see how better I can tackle the situation.

Appreciate any comments regarding this .

user229044
  • 232,980
  • 40
  • 330
  • 338
Satheesh Cheveri
  • 3,621
  • 3
  • 27
  • 46
  • 1
    1. Read first chapters of http://git-scm.com/book as some error might come from unnecesary operations. 2. Don't expect much from the IDE, in my experience Git support is better in Netbeans than Eclipse in even that is not complete so is better to to use the command line for some operations. – madth3 Oct 17 '12 at 16:19

1 Answers1

6

Those errors generally reflects a repo which hasn't been properly updated (git fetch or git pull), and is missing references to complete those operations (merge or push).

This thread illustrates the "missing commit" error on merge.

I had to pull from native git to solve that problem.
After that, for some reasons I don't understand, some of my source files had a "modified" marker, like if the merged source files were not locally committed or something like that.
I had to commit manually the merged code. Push was still failing. I had to pull again first.

The main issue with EGit is to make sure you are not in a detached HEAD mode (as detailed in "can't push upstream using EGit").

Beside that, it is best to train first following Egit tutorial and manual (and of course understanding git first, with git tutorials, like gitimmersion).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250