We are using VSCode in our project, we have .vscode/tasks.json
tracked on the server just to make sure everyone is aligned with the same configuration.
Since I wanted to add new tasks (just for me), I made this file skip-worktree
with git update-index --skip-worktree .vscode/tasks.json
.
But even though this file was committed only once on the remote, when we created the project, and never got an update, the git still says Your local changes to the following files would be overwritten
when I try to merge or rebase my current branch with main
.
Why does git want to overwrite the file even though it wasn’t changed on the remote? Is ther e anyway to make git be smarter to try to overwrite my file only when it is necessary (by showing it as a conflict)?
3