checkout a WIP branch and push it. You can pull it on any other computer you want, keep working on it till you are comfortable enough to merge back on master/develop.
I commit WIP code to a separate branch, change, and now if I go back to the original computer, I need to make sure to push, go back, pull again... god forbid I had done interactive rebasing or amended a commit, since it'll be all of of sync... it's just more more complicated than simply saving a file and having it reflected. "Temporary commits" should be a rare thing, not mandatory.
I end up using both git and dropbox for some projects and it mostly works, but having projects on dropbox is a mess because of node_modules, having sync running continuously because some tools/projects/IDEs will keep generating temporary files, etc.
Why not use a common git server? Why not use a dedicated backup solution? Many backup apps can store backups to Dropbox if that's what you want.
Myself, when I'm at home, I just check out the project on my desktop, use SSHFS to mount it on my laptop, edit it on my laptop or desktop as needed, and have an SSH window open from my laptop to my desktop for doing things like running npm (because that'd be way too slow if I ran it from the laptop and depended on SSHFS to sync it.)
If X11 or RDP was snappier, I'd just use my laptop as a thin client, but it's not, so I'm stuck with figuring out multi-master realtime source-code tree sync.
A similar problem obtains when using VMs, but at least there, there isn't the requirement that I have the ability to run a GUI text editor in the VM that sees changes I make outside the VM quickly enough to be unnoticeable.
basically, use FUSE to create an alternative view of your filesytem, but that fuse layer will also exclude certain files matching a regex. Only the FUSE view into your files should put in the Dropbox folder and synced. This particular fuse setup is read-only which was fine for my purposes, but you might need an alternative which allows write access for Dropbox.
But for personal projects I use syncthing, which supports .stignore, gives you versioning options, and most importantly doesn't randomly revert your files back to a previous version because of clock drift.
There are options for not syncing some files, for how to resolve conflicts, etc.
StackOverflow is filled with such answers. Which is why many people ask questions defensively, also mentioning the alternatives that they don't want to do. If I were to ask this as a StackOverflow question, I'd do it like ...
How can I make Dropbox ignore certain files from syncing? Is there some sort of .dropboxignore mechanism?
PS: I don't want to save files outside Dropbox's directory, I do want to synchronize my projects on Dropbox and lets assume for the sake of argument that I know what I'm doing.
(at which point I'd realize that I'm becoming aggressive and that I probably answered my own question, therefore closing the browser window in frustration)