Github - I would have to commit everything, even unfinished or completely broken files which seems like it would be a mess and quickly pollute by repo with unnecessary commits.
Git is basically designed to cope with development across multiple machines by multiple users. It offers a huge array of tools for dealing with this.
Feature branches
For each feature that you're working on, you can create a branch. Make changes to the branch and push them to github every time you need to switch machines. When you're finished and want to make a commit to the main branch ("master" or "develop"), you can first squash all the little messy changes into one clean change.
Alternatively, you can keep editing a single commit on the tip of the branch with "git commit --amend". I think this may require force-pushing though.
Patches
See https://stackoverflow.com/questions/4610744/can-i-get-a-patch-compatible-output-from-git-diff : you can create a patch file on machine A of your uncommitted changes, then apply it on machine B. However, going back again may be fiddly as you have to generate another patch, revert the local changes, apply the new patch ..
There's another workflow possible with "git format-patch" and "git am" (apply mail), which was intended for exchanging patches over email. Not too useful unless you're exchanging patches over email with yourself. And it requires you to commit.
Just share the files
If you commit to using only UNIX line endings, you can export the files from the Ubuntu machines as a SMB share and work directly on them with the Windows machines.
Or you could buy a NAS, like the popular Synology devices, and keep the files there.
Push between fileshares
The easiest way to do this is to have a shared directory between the two systems, but it can also be done if you can ssh into the Linux system from the Windows one.
$ git init localpush-A
$ git init localpush-B
$ cd localpush-A
$ git checkout -b devbranch
$ touch testfile
$ git add testfile
$ git commit -m "First commit"
[devbranch (root-commit) bfa4c99] First commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 testfile
$ git remote add other ../localpush-B
$ git push --set-upstream other devbranch
$ cd ../localpush-B
$ git branch -l -v
devbranch bfa4c99 First commit
$ git checkout devbranch
Switched to branch 'devbranch'
$ git log
commit bfa4c99c27851d5596f125b613e10b990dcbc8f0 (HEAD -> devbranch)
Author: me
Date: Mon Sep 23 10:59:44 2019 +0100
First commit
$ touch differentfile
$ git add differentfile
$ git commit -m "Second commit"
[devbranch a294f9d] Second commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 differentfile
$ cd ../localpush-A
$ git pull other devbranch
From ../localpush-B
* branch devbranch -> FETCH_HEAD
bfa4c99..a294f9d devbranch -> other/devbranch
Updating bfa4c99..a294f9d
Fast-forward
differentfile | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 differentfile
(Full explanation available on request, this answer is already getting long)