But for some reason I have a blind spot for git, and I would really like someone to help me get going.
You could pay it forward, or I could help you get started in hardware...
Best
G
![]() ![]() |
My advice is to not try and learn all of git at once. Focus on the few key commands you need to get going. I'm far from a git guru but I can clone a repository (git clone user@host...), make changes (git add *), commit them (git commit -m "First commit!"), and push them back to the master (git push origin master). Once you get that mastered you can start looking at branches and merging and tags. Most of the hosted source control services (GitHub, BitBucket, etc) have tutorials about how best to deal with those services.
spicedreams: I am developing software for arduino, and want to join in the whole sharing thing... But for some reason I have a blind spot for git, and I would really like someone to help me get going. You could pay it forward, or I could help you get started in hardware... Best G
What ya up to coding on Arduino?
The little things make the biggest difference.
The GitHub windows app is easy to use, you set up a folder for the repository, and any changes you make to files inside it picks up the changes which you can then make a commit, it then has a sync button which pushes it up to GitHub
When I first started with git I struggled. I was using it and not really getting it or understanding why I had to do certain things. I was blindly following a few basic approaches. If things blew up (they often did initially) I'd just resync from Github and start my change again. And then one day I found this video:
Git for ages 4 and up https://www.youtube.com/watch?v=3m7BgIvC-uQ
I still highly recommend it today. Its great at getting a handle on what git is doing under the covers. A really good intro to git in my opinion (if you can get past the dungarees).
As for the whole Github integration and why you have that its worth researching (aka Googling) the "git triangle".
Shindig:What ya up to coding on Arduino?
I have built a 'thing' to listen to ocean sounds, intending to discriminate the sound of a vessel actively fishing from any other vessel activity.
It uses Teensy which is an arduino on steroids, including a digital signal processor, more memory etc.
Its not too difficult. Most nasty devs will say RTFM: https://git-scm.com/docs/
Firstly your code is kept in a folder on your local machine. You can turn this folder into a git repository, simply by browsing to the folder and typing:
$ git init
Then you add the files in that folder
$ git add .
Now you code is under source control by git you have a large number of options. But you need to commit your files into the project.
$ git commit -m "My first commit for project x"
Generally the next thing you would do is add a remote origin. This means your project, all its folder structure, changes etc are all replicated in a remote location. Normally this would be a site like Github or Bitbucket. It could even by a private bitbucket or github enterprise server.
You can add an origin to your project by typing:
$ git remote add origin https://pathto.git.repo/etc
$ git remote -v
Then to actually push your files up to the repository you use:
$ git push
Now your code is remotely stored and is managed by a remote server. Other git clients can now clone your code (if they know the password or its public) and you can create copies of it really easy in other locations.
Now if you want to change your code.
All you do is change your code. then type:
$ git status
This will show you all the of files that have been added, removed or modified. You can then add them to a commit, by using git add filename.xyz or git add * if you are feeling keen. Then you can commit using the commit command above and then push (same as above).
The next thing you need to know is how to get a copy of the code that is in a repository onto your machine. This is done via cloning.
$ git clone https://pathto.git.repo/etc.git /path/to/localfolder/where/you/want/to/put/the/files
this will download the project to the folder in the 3rd argument. If you dont specify a path it usually make a folder in the current working directory.
To pull in any updates, you use:
$ git pull
Sometimes git pull will have a moan because you might have modified the files locally so you need to use git stash, or commit your current project to a branch.
I could write more, but I rekon you read up on branches and merging. https://git-scm.com/docs/git-branch
Also using a tool like tortoise git/smartgit/sourcetree for windows or smartgit/sourcetree for mac or meld for linux might make life a bit easier. And if you are using windows make sure you commit your files with unix style carriage returns and have windows convert it automatically, with the exception of windows coding like c# projects.
darylblake:
$ git pull
blergh. What you really want is
$ git pull --rebase
:)
"I was born not knowing and have had only a little time to change that here and there." | Octopus Energy | Sharesies
- Richard Feynman
![]() ![]() |