Git在切换分支之前不要求提交

Uri*_*Uri 2 git

如果我运行git status:

# On branch new-media
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .gitignore
#   modified:   app/views/layouts/application.html.erb
Run Code Online (Sandbox Code Playgroud)

然后我结帐大师: git checkout master

M   .gitignore
M   app/views/layouts/application.html.erb
Switched to branch 'master'
Run Code Online (Sandbox Code Playgroud)

以前,git阻止我签出其他分支,提示我存储或提交对当前分支所做的更改。现在,它不再这样做。

joh*_*man 5

如果两个分支上更改的文件相同,则Git会使用工作目录肮脏的方式切换分支。如果没有,它将阻止您。您可以使用该-m标志覆盖此行为。

看到