← Zurück zur Übersicht

IOT10 Version Control with GIT

Veröffentlicht am 2020-11-15 00:00:00.0


IOT10 Version Control with GIT

Version Control for Development

What is GIT

Git is a demonstration of the sucess of open source

Git is a distributed version-control system for tracking changes in source code during software development.[8] It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed,[9] data integrity,[10] and support for distributed, non-linear workflows.[11]

Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development. Its current maintainer since 2005 is Junio Hamano. As with most other distributed version-control systems, and unlike most client–server systems, every Git directory on every computer is a full-fledged repository with complete history and full version-tracking abilities, independent of network access or a central server.[13] Git is free and open-source software distributed under the terms of the GNU General Public License version 2.

What is GIT used for

  1. for security in development
  2. for working in a team with a central repository
  3. the developement of Linux worldwide
  4. many other open source projects
  5. Microsoft acquired GitHub for $7.5 billion Dollar 2018
  6. The Eclipse Foundation reported in its annual community survey that as of May 2014, Git is now the most widely used source-code management tool, with 42.9% of professional software developers reporting that they use Git as their primary source-control system

Install and configurate of GIT for arduino

  1. There are also a few ways to install Git on Windows. The most official build is available for download on the Git website. Just go to https://git-scm.com/download/win and the download will start automatically. Note that this is a project called Git for Windows, which is separate from Git itself; for more information on it, go to https://gitforwindows.org.
  2. Using GIT for arduino from the commandline on WINDOWS: This crash course only uses Git from the command-line. You can use Git Bash; a Linux like shell for Windows. If Git is installed correctly, the exact same commands should work in a Windows Command Shell.

Install and configuration of GIT for arduino

  1. Change the directory to your actual project like cd /c/ProjectsSplit/Arduino15/Sketch/MotorThing
  2. Use the init command: git init
  3. Use the add command: git add .
  4. Use the status command for looking for first details: git status
  5. use git commit -m "CP Project Mashines Initial commit."
  6. If you change files or add files just use the combination of git add * and git commit -a -m "For Example:Start for adding serial debugging."

Usage of GIT for arduino

  1. If you did some development use git diff and you will see, what you have changed since the last commit.
  2. If you then think, this changes were stupid and you want to get rid of them, do first
  3. a commit like this : git commit -a -m "Bad news. Dead end. And a terrible mess."
  4. then use the folling command: git revert HEAD --no-edit

Usage of GIT for arduino

There are some other usefull commands:

  1. Always work with a testing branch you start with git checkout -b test for example
  2. With git branch you will see the branches of the project
  3. With git branch master and git branch test you can just switch from one to the other one
  4. if you later want to merge both branches again you can use git merge

Usage of gogs or gitea

If we want to start from the scratch, it usefull to start with a central repository. Lets try gogs.

You find it under gogs

  1. you could use MySQL or POSTGRES as database for gogs
  2. On MySQL use etc/mysql.sql to create a database with the name gogs
  3. Postgres
    1. su - postgres -c
    2. createuser -P gogs
    3. createdb -O gogs gogs
    4. of course install git

Usage of gogs or gitea

  1. Download gogs for your device . If you have Raspberry Pi, we could use it as a server!
  2. unzip the arcive
  3. cd to the unpacked directory
  4. start ./gogs web

Usage of GIT for the arduino in a team

  1. if you want to download a project from a cental server do it with git clone
  2. e.g. git clone https://github.com/sudar/arduino-sketches.git
  3. if you have created a project on gogs you get an information on the webseite how to clone the project
  4. if you want to develop first independly from the team create a branch like git branch experiment or test
  5. if your work has been sensefull you could merge it to a central used branch like development before merging it to master

Usage of GIT for the arduino in a team

  1. you could also copy useful classes or partrs to the development branch
  2. to put changes to central repository use git pull
  3. if you created a locally project , you can also put it to the central repository like
  4. git remote add origin git@your_gogs_repos_here.com
  5. git push origin master
  6. git checkout develop
  7. git push origin develop
  8. for puplishing a local branch to remote: git push -u origin develop
  9. To get changes from the remote repository you can use git pull.
Info

Diese Seite wurde dynamisch aus Groovy-DSLs generiert.


User: