I'm working on a project in both Ubuntu WSL and Windows 10. I want to be able to edit the files in both windows 10 files system via sublime/...and in Ubuntu WSL via VScode/...and push changes to remote. I have noticed 2 issues when doing this:
- When I edit via VSCode on Ubuntu WSL, the file mode is changed to 755 and when I edit on windows the filemode changes to 644. So, every single commit has thousands of changes - just for the file executable bit change.
What should I do such that editing and pushing changes across windows filesystem and WSL filesystem retains the same mode?
Right now, I'm experimenting with using the below command every time I do a change via windows.
git add . --chmod=+x
(source: How to create file execute mode permissions in Git on Windows?) Is there a better way to handle this situation?
- Sometimes, the git diff shows the entire file being removed (i.e, all lines) and all lines added again. something like:
- print('hello')
+ print('hello')
I'm not sure why this happens.
I'm still learning Git and would like to know if what I'm doing is correct or if there are better ways to handle editing the same repo from different file systems.