I am using my OneDrive to commit changes to and push updates using VSCode. On my desktop and my laptop I have the same directory within OneDrive opened in my workspace. All the changes are the same and code is identical, but the thing I'm concerned about is if I am working on my desktop it only says I have 1-2 changes to commit (typically the file I'm working on). However, on my laptop even though I'm using the same OneDrive cloud directory it says I have 33 changes to commit. I'm not sure why its showing that. I tried running a git pull in VSCode but it still shows the same 33 changes to commit. I haven't committed anything on my laptop yet as I'm not sure if it will overwrite anything. I just don't understand why the difference even though it's using the same directory on the Cloud. I checked in that directory and I am seeing only one ".git" hidden folder with no other nested ".git" folder inside. Any help would be great, thanks!
Dan
To put the various warnings in the comments into answer form - this is not a reliable way to share a repo between computers. You should create a local clone on each computer. The problem you're experiencing is just one of the minor annoyances that can go wrong - things could (and likely will) get a lot worse if you continue with that approach.
FWIW I suspect the specific problem may have to do with the way git uses file stats to tell where changes might potentially be; but I don't know enough about OneDrive to pin down an exact explanation.
But it doesn't really matter. Sharing repos between folders is built-in git
functionality, and you'll be much better served by using it as intended. Note that if you want, you can create direct links between your two clones so that you don't have to push changes through the origin; or if that isn't convenient to do, you could even use OneDrive to pass bundle
files back and forth (https://git-scm.com/docs/git-bundle)
Those approaches do still require you to commit the changes you share. (Those commits don't have to be on your main branches, and you don't have to keep them, but it is an extra step to sharing them.) If that's a problem, you could even keep a copy of the working folder (but not the entire repo) on OneDrive, and copy updated files back and forth through that copy. You'd still have to make sure your files sync when appropriate, but it's a less risky option than working directly on the sync'd directory.