Today, I was moving my files to my new Surface Studio 2 (which is an awesome development machine!); All my personal files are synched to OneDrive, except for my Visual Studio and GitHub project files which are — by default — stored in c:\users[myuseraccount]\source\repos.
Synching your personal files to OneDrive makes it really easy to work on multiple devices or making sure that you have a backup in case your workstation is stolen, lost, self-destroyed, or abducted by aliens.
Making sure that your project files are also synched ensures that all those prototypes, proofs of concepts, and other code snippets that you never bothered adding to source control are also safe.
This article describes the steps to move your default project location to a folder that can be stored in OneDrive.
Let’s make one thing clear: synching your project files to OneDrive does not replace using source control; if you have any production code in your project files, please use source control.
The instructions above will default your new Visual Studio projects and repos in a OneDrive folder; they’ll get synchronized with OneDrive.
Thanks to Daniel Zikmund for the detailed steps on how to set up the folder in Visual Studio. Also, Andrew Grant has a great video showing how to do the above steps.
I hope this helps!?
UPDATE: I apologize to Daniel Zikmund, I gave your brother Martin credits. Thanks Martin for letting me know.