frixaco / codesync

Codesync (WIP) - VS Code extension to synchronize uncommitted code changes across devices
MIT License
3 stars 1 forks source link

Using `patch` command to apply patches when Git indexes don't match #8

Open frixaco opened 2 years ago

frixaco commented 2 years ago

I just discovered that I can run patch -p1 <patch.file> to apply diffs and seems like it's less strict than git apply. Also there's diff command which generates diffs just like git diff. I suggest (to myself) to investigate both commands (diff and patch) and see how they compare to Git's diff and apply. If it's just diff to create the project and then just patch to apply it without any additional steps like with Git, I'll switch to them.

frixaco commented 2 years ago

Git throws No valid patches in input (allow with "--allow-empty") for empty diffs