Automagically resolve conflicts upon remote deletion/moves
Scenario:
- Instructor creates repo with file
A/b - Student nggitpulls repo
- Student edit
A/b - Instructor
git rm A/b(variant:git mv A/b A/c) - Student nbgitpulls latest version
This currently results in a merge conflict. Instead, in the general spirit of nbgitpuller some opinionated decision should be made.
Presumably:
- leave local file untouched (tracked by git? not any more?)
- warn the user:
A/b was removed/renamed remotely; left local copy untouched
(thanks btw for this useful tool!)
Yesterday I ran into the same problem. And then I wanted to see what happens if instructor re-adds the deleted file and then student nbgitpulls latest version:
- Instructor creates repo with file
A/b - Student nggitpulls repo
- Student edit
A/b - Instructor
git rm A/b(variant:git mv A/b A/c) - Instructor adds the file back (e.g.
git revert <previous_commit>) - Student nbgitpulls latest version
The result is that the file, which is edited locally, is renamed and untracked and the file from remote is pulled. That means even the file is tracked by git, nbgitpuller thinks that it is untracked and renames it. I am still not sure if this is another problem/bug. But if this behaviour is correct, then for the problem stated by @nthiery, nbgitpuller should also untrack local file (git rm <file> --cached). If you agree, I would like to work on this and make a PR.