Every time I pull from remote to my local, I see a file being deleted in git changes (with no input from me). The file does exist in local but 3 or 4 times I’ve checked and that file doesn’t exist in the remote repo. If I push the deletion I of course get merge conflicts. Last time it happened I recloned the repo locally, but still the pesky file is there on local.
I use VS2022 connected to Azure dev ops.
Update: Yes, same file name/ext each time. It’s a little tricky because I’m tracking a static web site and the file doesn’t exist in the src files, but does in the compiled “dist” directory. I’d expect when I compile the site, it wouldn’t include the file but it does. In this scenario, would adding the file path to gitignore cause any merge issues?
2
Add the file to ‘.gitignore’ file, so it’s not tracked
According to your update, the file is always the same file name/ext each time.
In this case, adding the file to .gitignore
is a good solution so that Git doesn’t track the file and changes to it don’t appear in the list of changes to commit. You can add the path dist/yourfilename.extension
to .gitignore
file and commit the .gitignore
file to your repository.
In this scenario, would adding the file path to
gitignore
cause any merge issues?
This will not cause any merge problems because .gitignore
only affects untracked files, not files that are already tracked by Git. Since the file does not exist in the remote repository, there should be no conflicts when merging.