2

If I have some changes in BranchA and then checkout BranchB those files are auto merged into BranchA.

I used to get a warning that forced me to either commit or stash the changes: something like: my_file.rb would be overwritten by merge. Cannot merge.

At some point this stopped happening. Any thoughts? Here's my .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
jacklin
  • 2,739
  • 1
  • 24
  • 31

2 Answers2

1

It's only changes that you haven't commited yet that git complains about.

rtn
  • 127,556
  • 20
  • 111
  • 121
  • Yeah, its supposed to complain about the uncommitted changes. That's what I want, but instead it just lets me do the checkout and it merges the uncommitted files in without the warning / error that most people get ( including me on my other machine ) – jacklin May 12 '11 at 15:42
0

Update:

While answering a similar question, I realized that I had answered this same question elsewhere as well and while searching, also came across this answer that I had made sometime earlier. Below is the link to that answer, which I believe is to be the right one:

Git branches behaving strangely


Old answer:

Unless you are using git checkout -m or -f it should still be saying that.

What does git status tell you?

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417