Re: Discussion for Git tutorial

My opinion is this is too much information for an introduction of a tutorial targeted to a reader who is at least moderately experienced with Arduino, but has no experience with Git. You risk overwhelming them.

Focus on the things the reader is going to need to achieve the equivalent of their existing "cave man version control" system of saving copies of the sketch.

The only concepts they need to know to get started are:

  • How to initialize a repository in their sketch
  • How to make commits

Once they have gotten a start with Git by making commits in their sketch repository, they will get the basic understanding of what Git is and see the value in it. They will then be ready and motivated to learn the other valuable concepts.

I agree 100%. Arduino beginners should focus all their attention on learning programming and electronics. The harm of adding in the complexity of learning Git at the same time would outweigh the benefits of using a professional quality version control system at that stage in their journey.

Instructions for installing Git on Windows:

1. Open the download page in your web browser:
   <https://git-scm.com/download/win>
1. Click the "**64-bit Git for Windows Setup**" link on the download page.
1. Wait for the download to finish.
1. Run the downloaded file.
   An installer dialog will open.
1. Complete the installation via the installer dialog.
   **ⓘ** The default settings of the various options in the installer will be fine.

Instructions for installing Arduino IDE on Windows are available here:

https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing

1 Like

The instructions for Windows:

1. Click the Windows "Start" button.
1. Type `powershell` in the search field.
1. Select "**Windows PowerShell ISE**" from the search results.
   A "**Windows PowerShell ISE**" window will open.
1. Click on the terminal panel of the "**Windows PowerShell ISE**" window.
   **ⓘ** The terminal panel is the part that has the command prompt like `PS C:\Users\per>`
1. Type the following command:
   ```text
   git config --global user.name "<username>"
   ```
1. Replace `<username>` in the command with your name or any nickname you want to attribute your **Git** commits to.
1. Press the **<kbd>Enter</kbd>** key.
1. Type the following command:
   ```text
   git config --global user.email "<email>"
   ```
1. Replace `<email>` in the command with the email you want to attribute your **Git** commits to.
   **ⓘ** You can use a fake email like `fake@example.com` if you are concerned about your real email being harvested from the commit data by spammers in the event you publish your Git repositories on the Internet.
1. Press the **<kbd>Enter</kbd>** key.
1 Like

It is installed as part of the "Git for Windows" package so no additional action is needed by Windows users beyond the Git installation instructions I provided above.

Yay! Now I can learn how to use git and GitHub. :slight_smile:
Instructions for MacOS?
Little experience with CLI though.
Will use git with gui.

Will try to do.
J-M-L and daveet have Macs.
Daveet's one is pretty old though.

I found this (free) MOOC (online class) very useful and well-targeted to the relative beginner:
https://www.udacity.com/course/version-control-with-git--ud123

I'd tend to think of something like this as starting off with an overview of why a person should be interested in using source control tools rather than just a simple git tutorial.
i.e why is using source control tools like git preferred over just making copies / snapshots of the working directory tree.

I think the hardest part is getting people over the hump of believing that they don't need a source control tool.
i.e. they believe that just making multiple copies of their project is good enough.
And even when they may agree that using a source control tool might be a good idea, many will not want to invest any time to learn how to do even basic operations since they really haven't fully bought into it as they are not yet seeing how it really benefits them.

So, I would think part of a tutorial, particularly one aimed and less technical users and those that have not ever used source control tools, is first explaining what the source control tools can do and then how they can make things easier and save time.
To first convince them that using source control is in their best interest and can make them more productive.
So first draw them in to wanting to use source control,
then get into how to use the source control tools like git.

Me, I can't imagine ever writing any s/w without using source control on it.

I've always used source controls for all of my projects (professional as well as personal) going back to the early 80s.
Things have improved greatly since the days of SCCS through RCS, CVS, SVN and Hg.
These days by far, I prefer git for source control management and absolutely love using ribbitvcs.

IMO,
Most users would be well served used a GUI wrapper for git like rabbitVCS (linux) or tortoiseGit (Windows)
and meld

The really nice thing about these particular tools is that they integrate into the native OS file manager so users don't have to learn yet another tool since you do the git operations directly from the native file manager using context menus by right clicking.
These tools show really nice icons indicating the source control status of your files directly in the file manager.

Even for users that don't / won't use a source control tool like git.
using a tool like meld can be a real benefit and an time saver.
They can meld compare entire directory trees of their saved project trees to see what has changed between their snapshots.

--- bill

I :heart: you.

That's the part which I never got right; I do not know why exactly, maybe because I pushed from here directly and hence missed a step (or two or three). I only ended up with branches.

I am using windows 11 so some stuff had to be translated, but I was easily able to do that. I didn’t have any trouble following these instructions and have tried to record what I did below. Now I’ll try using it occasionally, especially when I make really big changes in the code.

Thank you for doing these instructions.

Here is what I did:

Downloaded GIT from Git - Downloading Package (git-scm.com)

Installed with all default options

Loaded Blink and put an error in it, saved it to desktop\blink

Used Command prompt:

git config --global user.name "delta-G" (but with my name)

git config --global user.email "deltagrobotics@gmail.com" (but with my email)

opened Blink in the ide

cd desktop

git-gui

set directory to c:\users\mike\desktop\blink

hit ok

hit create

gui window shows unstaged change as blink.ino

clicked stage changed, then commit

******************* side stepped here to put the git gui icon on the task bar

fixed the blink error and ran it

unstaged blink.ino shows up

hit stage changed, then commit

hit f5 to show changes

Hit repository, visualize master’s history

Saw the changes in red/green

Created a branch

Changed it

Hit f5

Hit Stage changed and commit

Visualized master and commit

Everything seems to be working

THANK YOU!!

Great! Have not started but now i understand more about Git and GitHub.
I used to have like ten different files of a single project at different versions.
Now can use Git.

I have the feeling that there are some repeats in this topic; I might be wrong. If there are, it needs to be cleaned out for a tutorial.

1 Like

Found this:
https://desktop.github.com/
Seems like it would be more friendly to non cli users(including me)
Going to learn cli to.

Do you want the new topic to be locked so people don't post in it?

I've closed the topic. I think you can delete your reply in there as @awneil deleted his post.

I don't advertise it :smiley: I leave the usual locking to moderators.

Maybe move new thread to introductory tutorials?

Wait. Why can’t you move it to that category?
I thought it was open to all users?

Like this maybe?
Not sure.
I Agree that we should wait for strerretje.