git - git如何检查是否需要 merge ?

标签 git git-merge

根据 documentation , git update-index --refresh 这样做:

Looks at the current index and checks to see if merges or updates are needed by checking stat() information.

git“检查是否需要 merge 或更新”是什么意思?git 是否在某处保留一个任意标志,在某些操作后说“mergeme”?

此外,我想我了解 stat ( what is "stat information" in a git index? ),但我不明白如何了解 the UID 这样的事情帮助 git 知道是否需要进行 merge 。

最佳答案

描述有点误导。此命令检查工作副本是否与索引不同。在此上下文中, merge 意味着您需要使用 git addgit rmgit checkout 来带来索引和工作同步复制。这与 git merge 无关。

索引存储工作副本文件的快照 stat 信息,以优化对用户修改的检测。每次将这些修改插入暂存区(git addgit rm)或丢弃工作副本修改(git checkout)时,它都会更新code>, git reset, ...).

关于git - git如何检查是否需要 merge ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5327559/

相关文章:

git - 中止 git merge 并返回到未提交的工作

git - 将远程存储库映射到包含文件的现有目录

git - 如何在没有互联网连接的情况下在 ubuntu 上提取 git 存储库?

git - git rebase没有应用提交

windows - 将 Git 核心编辑器更改为 Notepad++ 导致问题

git - 是否可以使用交互式 git rebase 从历史记录中删除文件?

git - Git 中的 merge 是对称的吗?

git - 使用 LFS 初始化裸 git 仓库

Git:在 merge 中切换分支

git - git 和 append-moSTLy 文件的策略