Reputation: 1
After dabbling for a few years in coding (and getting hundreds of answers from Stackoverflow), I've decided to commit to a version control system. I am a frequent user of onedrive, and would like to synchronize through that to use multiple machines for development.
After a first failed attempt, I looked up some instructions, and have proceeded as follows:
I set up a bare repository on OneDrive, and cloned that to local repositories on my two main machines. What I would like to do is to be able to make some changes, stash them, drive to work, and access the stashed changes on a different machine. Is this possible, or do I just need to create a branch and commit in order to do this? Or, is there a way to use a OneDrive folder from both machines, and and just see all my work in one place?
Upvotes: 0
Views: 1048
Reputation: 1685
Possible? Probably, so long as you can mount OneDrive to a local file system.
A good idea? Not in the least, on two points:
Firstly, stashes are meant for very temporary operations; if you want to keep your changes for any length of time, branches and commits are advised.
Secondly, your use case calls for accessing code from multiple machines, and you are apparently not in a position to host a server, you'd be well advised to use a free git repository service, such as GitHub. Using OneDrive to host a git repo circumvents a lot of git functionality, which puts your code at risk.
Upvotes: 0
Reputation: 1217
Stashed changes are local only, so you wouldn't be able to see them on a different computer.
do I just need to create a branch and commit in order to do this?
Yes. This is consistent with Git Flow, and is a much safer way to work. In general, unless you have a strong reason to stash, adding and committing changes makes for the most reliable way to keep track of changes, even if you feel they aren't complete.
Upvotes: 1