简体   繁体   English

更改的文件始终显示在主分支中

[英]Changed files always showing in main branch

Does anyone know what causes this?有谁知道这是什么原因? I've pushed some files to my branch.我已经将一些文件推送到我的分支。 It has no conflicts whatsoever, so my senior have merged it with the main branch, but whenever I switch to the main branch to fetch origin to get the latest update, the files that I've worked before previously always show up in the main as changed files but with "deleted" mark on it.它没有任何冲突,所以我的前辈已经将它与主分支合并,但是每当我切换到主分支以获取源以获取最新更新时,我之前工作过的文件总是显示在主分支中已更改的文件,但上面有“已删除”标记。 Also, the files keep returning whenever I discard the changes, switch to my branch, and switch it back to main.此外,每当我放弃更改、切换到我的分支并将其切换回主分支时,这些文件都会不断返回。

I'm using Github desktop.我正在使用 Github 桌面。

You're probably just misunderstanding the GUI display.您可能只是误解了 GUI 显示。 It's confusing.这很令人困惑。 (That is one reason why I never use a GUI on Git.) It sounds like a matter of interpreting a diff. (这就是我从不在 Git 上使用 GUI 的原因之一。)这听起来像是解释差异的问题。 If your local main branch did not have these files, and you fetch the remote origin/main which does have these files, then it is perfectly true that with respect to origin/main, your local main branch is "missing" the files, which is what your GUI portrays as "deleted".如果您的本地主分支没有这些文件,并且您获取了确实有这些文件的远程源/主,那么就源/主而言,您的本地主分支“丢失”文件是完全正确的,这是您的 GUI 描述为“已删除”的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM