1

Super weird error, I looked around and found these similar questions, however I am not sure it's the same:

Error rebaseing/updating a git-svn repository

git-svn rebase error

update-index --refresh: command returned error: 1

This part of the error looks the same, however as you can see below, I don't have anything in my working directory (I ran a git status right before typing git svn rebase). I tried doing a git reset --hard and running it again with no luck.

mac-jd:IPhone jd$ git status
# On branch master
nothing to commit (working directory clean)
mac-jd:IPhone jd$ git svn rebase
branches/TechDev/MySecretProj/MySecretProj.xcodeproj/project.pbxproj: needs update
update-index --refresh: command returned error: 1

mac-jd:IPhone jd$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   branches/TechDev/MySecretProj/MySecretProj.xcodeproj/project.pbxproj
#
no changes added to commit (use "git add" and/or "git commit -a")

This seems like a subtle bug and any help would be greatly appreciated. Thanks a lot.

EDIT:

FIGURED IT OUT:

I am going to leave this here for anyone else who's made this stupid, stupid, mistake. Close XCode before running the rebase -_-

Sorry to waste the time of those helping with answers.

I am working on a mac. The diff, when I ran it, after I tried the rebase shows me one line changed:

Before rebase: 6A31D44715A5B64700AF77D8 /* libDevUtils.a */ = {isa = PBXFileReference; lastKnownFileType = file; name = libDevUtils.a; path = "Classes/Tools/SiteCodes/DevUtils/build/Release-iphoneos/libDevUtils.a"; sourceTree = "<group>"; };

After rebase: 6A31D44715A5B64700AF77D8 /* libDevUtils.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libDevUtils.a; path = "Classes/Tools/SiteCodes/DevUtils/build/Release-iphoneos/libDevUtils.a"; sourceTree = "<group>"; };

To help, the only thing that changed between the two lines is the lastKnownFileType which changed from 'file' to 'archive.ar'

Community
  • 1
  • 1
fjlksahfob
  • 1,019
  • 3
  • 16
  • 27
  • Are you working on a Mac? I can't help but wonder if it's some funny business with HFS+ that Git doesn't like or doesn't understand. – L2G Jul 06 '12 at 16:40

2 Answers2

1

I don't know what that project.pbxproj file is, but could it be that it has been changed by some application between the moment you call git status and the moment you call git svn rebase?

In that case, you should consider removing it from your repository and adding it to your .gitignore file.

Misch
  • 10,350
  • 4
  • 35
  • 49
  • 1
    I'll mark this as the answer because something was happening between the `git status` and `git rebase`; XCode was indexing the files and changing the file types and I forgot to close it. -_- pbxproj files can't be removed from the repo, in case you're interested, they are used to track metadata on your project. – fjlksahfob Jul 06 '12 at 17:15
  • +1 for mentioning .gitignore. You should **never** put IDE related project configuration files in the repository, as they are highly dependent on the user settings of the developer and interfere with other user's configuration files. – leemes Jul 08 '12 at 10:05
0

I am not sure if this will help. But it once happened to me that I had created a new branch and then I tried to rebase to a commit BEFORE i created the branch, thereby failing to rebase. I fixed this by deleting the branch entry, i think.

Steven
  • 974
  • 6
  • 18