I have local repo and remote, say "upstream". In remote repo some basic configs say "file1.txt" and "file2.txt", I pull changes to branch "some_branch", and typed:
git update-index --assume-unchanged file1.txt
git update-index --assume-unchanged file2.txt
to allow modify this files, add some changes with my local changes, which I do not want to commit.
After that in "upstream" was added branch "somefeature"
fetch upstream somefeature:somefeature
and try:
$git checkout somefeature
error: Your local changes to the following files would be overwritten by checkout:
file1.txt
file2.txt
Please, commit your changes or stash them before you can switch branches.
Aborting
$git checkout -f somefeature
error: Entry 'file1.txt' not uptodate. Cannot merge.
then I try:
$git stash
No local changes to save
$git stash -u
No local changes to save
$git update-index --no-assume-unchanged .
Ignoring path
also I tried "--skip-worktree", but unsuccessfully also.
So, how I can skip local changes whan use "add" or "commit -a", but be able to change branch, and apply this hidden changes to unother branches, created not from current?