!CHAOS uses git as code version system and national open-source service "INFN Stash" for central approval server. 

In our development, the rule versions are expressed with the follow semantic: x.y.z-[alpha,beta,rc].yy.

  • Major version "X" is upgraded when in the framework are added substantial functionalities;
  • Minor version "Y" is upgraded when some functionalities are introduced and or substantial private code is changed;
  • Patch version "Z" is upgraded when bugs and wrong behaviours are solved;

next section of the semantic, define the stability of the code and identify its maturity level.

  • Maturity level is dived into three levels:
    • alpha: the code is working showing all its functionalities but it can develop a lot of bugs;
    • beta: represents the usable code with all its functionalities and can be used for testing the new ones;
    • rc: "release candidate", it identifies the code when is mature for release and the versioning with the minor tweaks ready to go on production.
  • YY: represent the minor version of the upper described maturity level.

GIT suggested documentation

comprehensive git documentation:

https://git-scm.com/book/en/v2

A nice command-line emulator (we suggest to keep it open alongside the documentation and use it to practice the commands)

https://try.github.io/levels/1/challenges/1

GIT useful commands

  • git status:  shows information about the status of the branch (file modified, to add, untracked)
  • git branch -av: shows information about all the branches (local and remote) of the git repository
  • git checkout -b <branch name>:  create a new branch  with the specified name.
  • git checkout -t -b <mybranch> <origin/branch name>:  create a new branch named <mybranch> from the remote <origin/branch name> and link them (tracking option)  with the specified name.
  • git checkout <branch name>: move to an existing one
  • git commit -m "comments" .: commit modifications to the local repository
  • git pull .:  update the local repository with remote changes of your local branch.
  • git push [origin branch name]: push local branch into specified remote branch.
  • git merge <branch name >: merge modifications of branch name into the current one
  • git clone <url of git remote repository>: will create a copy of the repository in your local directory

GIT typical case

I want to modify add something in a existing git repository. Ideal steps:

Let's suppose to be in the development or master branch.


0] be sure you are aligned with the remote

git fetch

git pull

1] create a new branch.

git checkout -b <my branch>

2] do your job
3] commit the changes to your local repository
git commit -m "comments" .
4] (optional) commit your changes also remotely 
git push origin  <my branch>
5] merge branch back (i.e in development)
git checkout development
git merge <my branch>
git push origin

GIT chaos wrapper

./tools/chaos_git.sh is a script that allows to perform the most useful actions on more than one git project. It applies git commands recursively on the subdirectories where it is launched (-h for help).

Client Tools

Windows/MAC https://www.sourcetreeapp.com/

Linux command line: sudo apt-get install git




  • No labels