Sometimes I would like to backup my codes to the cloud, even for some teeny-tiny projects. Some of these codes, however, are either not ready for the public or too shameful to let others see, so that I would not bother using the Github public repositories with them. Github for education offers free private repositories for students, but the number is limited to 7 and does not have very large space. That makes using OneDrive/Dropbox an option.
Here is an example. First we create a test project.
Then commit the changes as usual.
Create an empty repository in the sync folder, and add it as a remote.
Push the code to the repo.
The code should be synced to the cloud. You can access the codes from other terminals.
The method should be fine for backup purpose. But,
- Do not push from multiple terminals simultaneously, the repo could be damaged.
- Do not use it for cooperations, unless you can shout to your partner you are gonna push.
- Make sure the changes are synced before pulling from other places.