Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git签出不再警告未更改的文件_Git - Fatal编程技术网

Git签出不再警告未更改的文件

Git签出不再警告未更改的文件,git,Git,如果我在BranchA中有一些更改,然后签出BranchB,这些文件将自动合并到BranchA中 我曾经收到一条警告,迫使我提交或隐藏更改: 类似于:my_file.rb将被merge覆盖。无法合并。 在某个时候,这种情况停止了。有什么想法吗?这是我的.getconfig [user] name = <my name> email = <my email> [core] repositoryformatversion = 0

如果我在
BranchA
中有一些更改,然后签出
BranchB
,这些文件将自动合并到
BranchA

我曾经收到一条警告,迫使我提交或隐藏更改: 类似于:
my_file.rb将被merge覆盖。无法合并。

在某个时候,这种情况停止了。有什么想法吗?这是我的
.getconfig

[user]
        name = <my name>
        email = <my email>
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[color]
        ui = always
        interactive = always
        diff = auto
        branch = auto
        status = auto
[color "diff"]
        new = cyan
        old = magenta
        frag = yellow
        meta = green
        commit = normal
[alias]
        co = checkout
        ci = commit
        st = status
        br = branch
        hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
        type = cat-file -t
        dump = cat-file -p
[用户]
姓名=
电子邮件=
[核心]
repositoryformatversion=0
filemode=true
裸=假
logallrefupdates=true
ignorecase=true
[颜色]
ui=始终
交互式=始终
差异=自动
分支=自动
状态=自动
[颜色“差异”]
新=青色
旧=洋红色
frag=黄色
元=绿色
提交=正常
[别名]
co=结帐
ci=提交
st=状态
br=分支
hist=log--pretty=format:\%h%ad |%s%d[%an]\”--图形--date=short
type=cat文件-t
dump=cat文件-p

git抱怨的只是您尚未提交的更改。

更新:

在回答一个类似的问题时,我意识到我在其他地方也回答了同样的问题,在搜索时,我也发现了我早些时候做出的回答。下面是这个答案的链接,我相信这是正确的答案:


旧答案:

除非您使用的是
git checkout-m
-f
,否则它仍然应该这样说


git status
告诉您什么?

git status将显示尚未更改的文件。我没有使用-m或-f。我只是在做git签出分支(对不起,已经更改的文件:)是的,它应该抱怨未提交的更改。这正是我想要的,但它只允许我进行签出,并将未提交的文件合并到其中,而不会出现大多数人(包括我在另一台机器上)收到的警告/错误