I have been developing code for hobby projects across ESP8266, Arduino UNO, Python etc. for past 5+ years.

All this code is stored in either local drives of my computer, old hard disks or sent to myself as an email.

Please suggest best ways to commit all this code to git so that I do not rely on storing it locally.

I plan to use git extensions to handle the commits.

2 Replies 2

Have you already tried to create a repository locally with a remote on GitHub? If so, did you encounter issues?

It would help if you asked a specific question: see this for guidance .

What you describe doesn't sound any different from regular Git usage, so the "best way" is just the regular way; there isn't all that much to suggest.

  1. For each project, create a local Git repository. Put the files in it. Commit them all.

    If you have multiple versions of the same project – gather them all in one place, so that you could start by committing all files from the oldest version first.

    Then replace all the "version 1" files with "version 2" files and commit all of them again; then version 3, and so on.

  2. Then, if you don't want to rely on hosting the code locally – find a Git hosting provider (like GitHub, Codeberg, Gitlab, etc, etc), and create all those repositories there as well.

    Link each repository using git remote add ... and upload using git push.

(You can also do it the other way around, by creating repositories first on the website, then cloning the empty repository, but that doesn't really save work; you just do a git clone at the beginning instead of git remote add at the end, but everything else stays the same. Either way you still have to "push" to GitHub as a separate step – you are never "committing to GitHub" directly.)

If you have many projects, especially if some of them are very tightly related, you could keep them in a single Git repository (as subdirectories). If they're all inactive, you could dump them into a single repository as well. For non-related active projects, separate repositories are usually better.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.