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.
Change the default project directory
- In Visual Studio 2017, select the Tools menu, then Options.
- In the Options dialog select the Projects and Solutions category, then Locations.
- In the Projects location type (or browse to) a folder on your OneDrive where you want your new projects to be created.
- Click OK.
Changing the default Github repo location in Visual Studio
- In Visual Studio, make sure you’re connected to GitHub.
- From the Team Explorer pane, go to Settings.
- In the Settings pane, select Global Settings.
- In the Global Settings pane, type (or browse to) the folder you want to use in the Default Repository Location.
- Click Update.
The instructions above will default your new Visual Studio projects and repos in a OneDrive folder; they’ll get synchronized with OneDrive.
I hope this helps!?
UPDATE: I apologize to Daniel Zikmund, I gave your brother Martin credits. Thanks Martin for letting me know.