Git分支行为奇怪 [英] Git branches behaving strangely
问题描述
任何帮助都非常感谢。
unbuntu 10.10
git 1.7.1
github.com
这里是我的git config -l:
giggle.main-window-maximized = false
giggle.main-window-geometry = 993x731 + 318 + 160
giggle.history-view-vpane- position = 223
giggle.main-window-view = HistoryView
giggle.file-view-vpane-position = 153
core.repositoryformatversion = 0
core.filemode = true
core.bare = false
core.logallrefupdates = true
remote.origin.fetch = + refs / heads / *:refs / remotes / origin / *
remote.origin.url = **************************************
branch.master.remote =原点
branch.master.merge = refs / heads / master
submodule.config / shared_capistrano.url = ****************** capistrano.git
submodule.vendor / plugins / authentication_client.url = ********************。git
branch.dev.remote =原始
分支.dev.merge = refs / heads / dev
branch.1.3.9.remot e = origin
branch.1.3.9.merge = refs / heads / 1.3.9
当您切换分支并且文件仅在本地修改时,Git不会给您警告/消息(并且会将更改合并到其他分支中)。例如,您在 It seems like I have inadvertently modified my git config such that when I switch from branchA to master all changes are automatically merged to master. This happens without either my committing in branchA or my merging to master. In the past if I tried to switch branches after modifying a tracked file and without committing, I got "the uncommitted changes, can't switch branches" message, but now I'm unable to induce that behavior. Something has changed with my git config, but I have no idea what it might be. Does this sound familiar to anyone? Any help is greatly appreciated. unbuntu 10.10 here's my git config -l:
When you are switching branch and the files are only locally modified, Git will not give you the warning / message ( and will merge the changes into the other branch). For example, you have your repo on 这篇关于Git分支行为奇怪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! master
上创建了一个分支 temp
,并对该文件进行本地修改。现在,当你切换到 master
时,你将不会收到消息。另一方面,如果在 temp
中进行了更改并将它们提交(即 > master
)和然后你有本地修改,当你切换到 master
时, p>
git 1.7.1
github.comgiggle.main-window-maximized=false
giggle.main-window-geometry=993x731+318+160
giggle.history-view-vpane-position=223
giggle.main-window-view=HistoryView
giggle.file-view-vpane-position=153
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=**************************************
branch.master.remote=origin
branch.master.merge=refs/heads/master
submodule.config/shared_capistrano.url=******************capistrano.git
submodule.vendor/plugins/authentication_client.url=********************.git
branch.dev.remote=origin
branch.dev.merge=refs/heads/dev
branch.1.3.9.remote=origin
branch.1.3.9.merge=refs/heads/1.3.9
master
, create a branch temp
, have a local modification on the file. Now, when you switch to master
you won't get the message. If on the other hand you makes changes in temp
and commit them ( that is temp
diverges from master
) and then you have local modifications, it will give you that message when you switch to master