Unable to check other branches because the ignored file has local changes?

I get:

$ git checkout mybranch
error: Your local changes to the following files would be overwritten by checkout:
        .idea/workspace.xml
Please, commit your changes or stash them before you can switch branches.
Aborting

But .idea/already in mine .gitignore. If I do git status, no changes also occur.

Please advice.

UPDATE:

Thanks for the advice. I would like to go in mybranchand check, but I could not, because it did not allow me to switch! Provided that the correct behavior is ignored .idea/(these are project configuration files from the IDE), what should I do now? My goal is to go to mybranchand merge it with master. You can think of mybranchas a production branch and a master as a dev branch. Now I want to update prod, as the wizard is quite stable.

+6
source share
6

. git stash , , workspace.xml, , workspace.xml - .

, , git , mybranch, gitignore, master.

+1

-

git update-index --assume-unchanged <filename>

.

git update-index --no-assume-unchanged <filename>

, , .

: typo .

+4

, .idea/ .gitignore , , , .

, , .idea/workspace.xml, mybranch, .idea/ .gitignore, master, , .

+1

.idea/ .gitignore . , git status, . , .idea/ .gitignore mybranch?

mybranch .idea/workspace.xml, - .


, .idea/workspace.xml - . .idea/workspace.xml.old. mybranch , - .gitignore, .idea/workspace.xml. , , .

git stash, , , , , !

0

, : $ git checkout thatbranch error: Your local changes to the following files would be overwritten by checkout: wwwroot/js/intake/some-file.js Please, commit your changes or stash them before you can switch branches. Aborting $ git checkout thatbranch error: Your local changes to the following files would be overwritten by checkout: wwwroot/js/intake/some-file.js Please, commit your changes or stash them before you can switch branches. Aborting

thatbrach , thatbrach. git status . git stash , .

, , -: - .

, some-file.js - . , , .

.

0

GitHub Enterprise. - GitHub , . workspace.xml, , . .

0

All Articles