How are you used to work with Github

Hi,
I am used to upload some of my code to github but I would like to be better organized, sepcially with my Arduino project. As I have HTML, Flexbox CSS, Python but msostly are C++ programs for Arduino.

All my Arduino projects are in /Users/pierrot/Documents/Arduino but not all are in github. I have may be 5-6 project over 30-40 projects. My Python and HTML project are in htdocs folder of my local server. My Gihub Deskop link thoses projects but it become a mess.

My Idea is to have a folder Github and move all my scripts (C++, PYTHON, CSS, etc), which are published on github, into that folder. With the goal to centralize all project, , in the same localation. Then I will have a problem with my Arduino project. Because in the Arduino IDE (Setting), the scketchbook location is /Users/pierrot/Documents/Arduino with all libraries.

I guess, I can not have a github folder here:
/Users/pierrot/Documents/Arduino/Github/project1
/Users/pierrot/Documents/Arduino/Github/project2
/Users/pierrot/Documents/Arduino/Github/project3

How do you work with Github and Arduino file?
Is my idea not good?
Do you create all your Arduino project in the default sketchbook location and fetch only the project you want

Cheers

you can open an Arduino sketch in IDE from anywhere. it doesn't have to be in sketchbook.
libraries have to be in 'libraries' folder in sketchbook.

You can have as much git repositories as you like. And they can be stored wherever you like. Only repositories for Arduino libraries should be located in the libraries folder for easy testing. And you don't need to upload all repositories to github. You also can have local repositories only for version control locally.

i've never used IDE 1.x; but IDE 2 will auto-open files like *.ino, *.cpp, *.h, and *.md in the root folder of each sketch, in tabs that cannot be closed, and list them in the meatball menu. The big advantage of having your sketches in the local sketchbook is that they show up in the tree view, so you can see and open files in subdirectories, and file types that are not automatically supported by the IDE.

IDE 2 will scan for sketches in the sketchbook: any folder with an .ino file with the same name. So you could have

  • Arduino
    • hello
      • hello.ino
    • blink
      • blink.ino
    • Github
      • three
        • three.ino
      • four
        • four.ino

Having them under /Github would clearly tell you they are also stored there, but that's about it. If you start a new sketch, and then a week later, you decide to put it under version control, then you move all the files on disk? No, the more common way to work is to assume all projects are under version control; or can be easily made so, without having to move anything.

The same thing goes for stuff under htdocs. If three and four have web content, and both are available simultaneously, then you have those folders as children of htdocs; Github is not part of the URL.

If the web content is tied directly to the sketch, it can be part of the same Git repo (which is simpler than Git submodules)

  • three
    • three.ino
    • src
      • something.h
    • web
      • index.html

Then you create a directory symbolic link -- on Windows use mklink to create a directory junction -- so that it "appears" under htdocs

mklink /j /full_path_to/htdocs/three /full_path_to/Arduino/three/web

hello @Delta_G and @MicroBahner

Only repositories for Arduino libraries should be located in the libraries folder for easy testing

Thanks for your reply.
It's what I am going to do, finally. I will not have a common folder with subfolders with all of my repos.

My libraies with be sync in /Users/pierrot/Documents/Arduino/Libraries/

For exemple, my library EcoAneno wil be sync in
my libraies forlder in /Users/pierrot/Documents/Arduino/Libraries/EcoAnemo

As I am mac user, I will simply create a github folder with a link (ln) to my local repo. In that way, from my Github folder, I will an easy overview (and access) of all folders linked to a repo.

@kenb4 , thanks as well for your observation which make sense.

Thanks for sharing your point of view

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.