Stumped by Git/Xcode and GitHub for Mac
I have a Mac Pro and a Macbook Pro both working on the same project stored at GitHub. When I try to sync the Mac Pro using GitHub for Mac I see that I've somehow now got two branches, Head and Master. When I try to merge them, I get this error:
Failed to lookup reference. Failed to update loose reference. -entry not found in hash table.
When I try to sync from the MacBook Pro I get this error:
Uncommitted changes. Please commit your changes before syncing.
There is a DELETED Icon/r line in the underlying box. I have no recollection of deleting an icon. When I try to commit this "change" I get this error:
On branch master Your branch is ahead of 'origin/master' by 2 commits.
Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)
deleted: "Icon\r" no changes added to commit (use "git add" and/or "git commit -a")
If I try to sync using Xcode I get this error:
The working copy "Graphing-Calculator" failed to commit files. error: pathspec 'Icon\r' did not match any file(s) known to git.
I'm really stumped. Clearly I've done something wrong, don't know what that was, and don't know how to fix it. Guidance appreciated.
Update
When I try to roll back two commits on the MBP I get this error:
(
0 GitHub 0x0000000100096531 -[GHApplication presentError:] + 445
1 libdispatch.dylib 0x00007fff9277d90a _dispatch_call_block_and_release + 18
2 libdispatch.dylib 0x00007fff9277f77a _dispatch_main_queue_callback_4CF + 308
3 CoreFoundation 0x00007fff90564c0c __CFRunLoopRun + 1724
4 CoreFoundation 0x00007fff90564216 CFRunLoopRunSpecific + 230
5 HIToolbox 0x00007fff90f5c4ff RunCurrentEventLoopInMode + 277
6 HIToolbox 0x00007fff90f63c21 ReceiveNextEventCommon + 355
7 HIToolbox 0x00007fff90f63aae BlockUntilNextEventMatchingListInMode + 62
8 AppKit 0x00007fff913dc191 _DPSNextEvent + 659
9 AppKit 0x00007ff开发者_运维知识库f913dba95 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 135
10 AppKit 0x00007fff913d83d6 -[NSApplication run] + 463
11 AppKit 0x00007fff9165652a NSApplicationMain + 867
12 GitHub 0x00000001000014e4 start + 52
13 ??? 0x0000000000000002 0x0 + 2
)
Update
I'm pretty sure I've condensed it down to this: Git thinks the file Icon\r was deleted and wants to commit this change, but cannot find the file Icon\r. If I try to discard the change, Git gives me the error, "Icon\r did not match any file(s) known to git." How to proceed?
Thanks for the pointer to the ^M^M .gitignore solution.
To clear these entries from your working repo, without going through the process of creating a new repository, just do 'git commit -a'. This should delete the "/Icon\r" entries out of your git index.
精彩评论