1

I have 2 repositories: a local repository configured with Netbeans and a remote repository.

I have the same commits in both of them with one exception: the remote repository has one extra, newer commit.

I want to pull this commit to my local repository with Netbeans. So, I right click my project, Git->Remote->Pull, I choose the right branches and I press Finish. Netbeans gives an error:

Missing commit 38b55ec9cbd31cddeedec412fa9d66e2e979a3b4

I searched for this commit, but I couldn't find it in my local repository nor in my remote repository for the branch I want to pull. So, I searched for it in other branches and finally I found it in a totally different branch.

I'm not pulling that branch. Why does Git need a commit from a totally different branch?

I maintain my local repository with Netbeans, so in my local repository I don't think I have access to the command line. Is there any way I can force Git (Netbeans version) to make this pull?

Edit: In the meanwhile, I installed a git client. When I execute:

git log --full-history

It doesn't show commit 38b55ec9cbd31cddeedec412fa9d66e2e979a3b4. This is what is shows in my local repository(with a little editing) - the remote repository has one newer commit, but it's not the required commit either:

C:\Projects\Project1\mavenized\Front>git log --full-history commit 5cb2bc0ec4cc36b66422a5ed0b314343cded8e96 Author: #myname# Date: Fri Jan 31 08:29:31 2014 +0200

Front - Live version: 30-JAN-14

commit 6eb8a8b419cece4065eceafe733f1718cb4debec Author: #myname# Date: Wed Jan 22 14:30:37 2014 +0200

Front - Live version: 21-JAN-14

commit fcba1824dc8ef2bcad98d63e00b1f1a6af2495dc Author: #myname# Date: Wed Dec 18 16:58:52 2013 +0200

Front - First Commit
Anakin001
  • 1,226
  • 2
  • 14
  • 30
  • FYI git is entirely based on files in a .git folder. Any standalone git client or the git command line programs will be able to work directly with the directly if you can find where netbeans puts it. It is likely near the root of your source files and might be a hidden folder. – Othrayte Feb 11 '14 at 06:51
  • I will try installing a standalone client. Yes, Netbeans puts the .git folder in the source folder's root. Hopefully, the command line will help me understand more about this error. – Anakin001 Feb 11 '14 at 06:56

1 Answers1

1

As mentioned in this answer, your git repo would need the full history for any remote (pull/fetch) command to work properly.

A git log --full-history should show that commit.

The simplest solution would be to re-clone the repo and import it in your NetBeans workspace.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This is the main issue actually: it doesn't show that commit in my local nor in my remote repository. Only if I switch to another branch that shouldn't interfere in any way with the branch I work in right now, only then I can see that commit. I updated my question with the command's output. – Anakin001 Feb 11 '14 at 07:18
  • @user1691018 and if you re-clone that remote repo, do you still see the same error message? – VonC Feb 11 '14 at 07:33
  • Yes, recloning seems to solve the problem. Thanks VonC! But I still wonder why the error... – Anakin001 Feb 11 '14 at 07:46
  • @user1691018 I agree. This thread (https://cms.arstechnica.com/civis/viewtopic.php?f=20&t=1213703) mentions a disk space issue to explain the corruption, but I suspect it isn't the case for you. – VonC Feb 11 '14 at 07:48
  • No, disk space is not an issue. I will take a look on the thread you mentioned. The branch with the issue is maintained exclusively with cherry picks and I know this can induce problems, but I did it a lot of times without running into errors. Plus the log that doesn't show anything suspicious I would say. – Anakin001 Feb 11 '14 at 08:02
  • @user1691018 yes, I tend to avoid cherry-picking (http://stackoverflow.com/a/2628915/6309, or http://stackoverflow.com/a/13524494/6309) – VonC Feb 11 '14 at 08:22