首页 > 解决方案 > 在 Rebase、Fetch 和 Reset 之后修改 Git 文件

问题描述

我的同事用 master 重新设置了我的分支并做了一些工作并推送到了远程。为了防止冲突,他推后,我做了一个fetchreset --hard origin/<my branch>

我继续我的工作,并希望添加、提交和推送我的更改,但一些不属于我的文件被修改了。(我确定我没有碰过那些文件)

当我git status在我的分支机构做:

    $ git status
On branch my-branch
Your branch is up to date with 'origin/my-branch'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   1
    modified:   2
    modified:   3
    modified:   4
    deleted:    5
    deleted:    6
    modified:   7
    modified:   8
    modified:   9

no changes added to commit (use "git add" and/or "git commit -a")

我只更改了1和2,从3到9是我没有碰过的文件。

我的问题是:

1、为什么我没碰的文件被修改了?

2、如果我只git add对文件1和2做,会不会对以后有影响?(如对合并、拉动的影响)

标签: gitfetchresetrebase

解决方案


推荐阅读