0

Currently I'm struggeling with the problem, that git produces unstaged files after switching a branch with using git checkout f_refact_reg.

My tree is currently looking like this:

-------------------------master
        |------------------dev
            |---f_refact_reg

What I've done:

  1. I added and commited all changes in the dev branch and pushed it to the remote repository
  2. Checked out the master branch and merged dev
  3. Making a release
  4. Pushing to the remote branch
  5. Checking out the f_refact_reg branch
  6. Tried to merge dev into f_refact_reg to be up to date. Than this appears:

Git issue

I've already tried to override those changes or stash them and then remove the stashed files, or just checking the files out. But nothing seems to help.

How does I can solve this issue and why are this files "changed" after simply checking out the branch?

Thank you all!

Zoe
  • 27,060
  • 21
  • 118
  • 148
BendEg
  • 20,098
  • 17
  • 57
  • 131
  • @poke I try what you marked, but this does not explain why this happens after checking out a branch... – BendEg Feb 11 '16 at 07:48
  • 1
    From what you show in the screenshot, it explains it perfectly: You have modified files, you use `git checkout -- .` to replace those files and you still have modified files. That’s exactly what’s covered in the linked question. – poke Feb 11 '16 at 07:51
  • I've not changed them. This happens after `git checkout f_refact_reg`. – BendEg Feb 11 '16 at 07:56
  • That’s my point: you did not change them. There appear to be no changes, but Git still thinks there are changes in those files. Please check that linked question. – poke Feb 11 '16 at 07:58
  • @BendEg: what poke is saying is : you may see the effects of git automatically changing the line endings of these two files to suit your platform. Check the diff (in winmerge or something) for these files to see if they differ only on line endings. See [the linked question](https://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them) for more details on this problem. – LeGEC Feb 11 '16 at 09:16

0 Answers0