gpt4 book ai didi

xcode - 被 Git/Xcode 和 GitHub for Mac 难住了

转载 作者:太空狗 更新时间:2023-10-29 14:16:00 26 4
gpt4 key购买 nike

我有一台 Mac Pro 和一台 Macbook Pro,它们都在处理存储在 GitHub 上的同一个项目。当我尝试使用 GitHub for Mac 同步 Mac Pro 时,我发现不知何故我现在有两个分支,Head 和 Master。当我尝试 merge 它们时,出现此错误:

Failed to lookup reference. Failed to update loose reference. -entry not found in hash table.

当我尝试从 MacBook Pro 同步时出现此错误:

Uncommitted changes. Please commit your changes before syncing.

底层框中有一个 DELETED Icon/r 行。我不记得删除图标。当我尝试提交此“更改”时,出现此错误:

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")

如果我尝试使用 Xcode 进行同步,我会收到此错误:

The working copy "Graphing-Calculator" failed to commit files. error: pathspec 'Icon\r' did not match any file(s) known to git.

我真的很难过。显然我做错了什么,不知道那是什么,也不知道如何解决。指导表示赞赏。

更新

当我尝试回滚 MBP 上的两个提交时,出现此错误:

(
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 0x00007fff913dba95 -[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
)

更新

我很确定我已经将其浓缩为:Git 认为文件 Icon\r 已被删除并想要提交此更改,但找不到文件 Icon\r。如果我尝试放弃更改,Git 会给我错误消息“图标\r 与 git 已知的任何文件都不匹配。”如何进行?

最佳答案

感谢您提供指向 ^M^M .gitignore 解决方案的指针。

要从您的工作仓库中清除这些条目,而无需执行创建新仓库的过程,只需执行“git commit -a”。这应该从您的 git 索引中删除“/Icon\r”条目。

关于xcode - 被 Git/Xcode 和 GitHub for Mac 难住了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7452304/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com