Suppose I have a git repository with 2 branches:
Both of repositories contain the same files. But after running
file.exe it overwrites
config.xml so each branch contains its own version of this file.
If I want to
git checkout branch2 from
branch1 I get error that file
config.xml was changed. I tried to ignore this file with
.gitignore but after
git push remoteserver it removes
config.xml on remote server.
git update-index --assume-unchanged config.xml. After this I can push to remote server although
config.xml was changed but I still can't switch to another branch. The error:
Entry 'config.xml' not uptodate. Cannot merge. So my question - is there way to ignore file in local repository so I can push to remote server or switch to another brunch but not to remove this file at all? And nice option will be to push this file when I need manually.