<jupyter_start><jupyter_text>[Table of contents](../toc.ipynb) Why version control?If you never have heard of version control, you might be familiar with a working mode which is shown in this carton posted By <NAME> on [datamation.com](https://www.datamation.com/news/tech-comics-version-control-1.html).If this looks familiar to you, learn git and become professional. [Table of contents](../toc.ipynb) Version control with gitVersion control is one fundamental pillar in each software development project. There is no excuse to omit version control!Next to other version control systems like svn, [git](https://git-scm.com/) is the most popular and most prominent tool right now. Its main advantage is the **powerful branch and merge concept**, which **allows to develop software simultaneously and distributed**.Please find a much deeper feature description of git either on wikipedia [https://en.wikipedia.org/wiki/Git](https://en.wikipedia.org/wiki/Git) or in the git docu [https://git-scm.com/about](https://git-scm.com/about). There are different working styles in git controlled projects. These different styles are called branching models and the `master - feature branch` concept is a simple concept you can use for smaller projects. Please find here a picture of a git master feature branch network.The black solid line is the master and the shorter colored lines are feature branches which provide changed versions of the master. Each bullet is a commit.  Learn git in ten minutesAs pre-note, there is one superior git training web page [A great page to learn git interactively https://learngitbranching.js.org/](A great page to learn git interactively https://learngitbranching.js.org/) you should check out.Next we want to try to learn some basics of git in a couple of minutes. Git can either be used in terminal or through many GUIs like [git for windows](https://gitforwindows.org/), [sourcetree](https://www.sourcetreeapp.com/), [gitkraken](https://www.gitkraken.com/).As there is so much training material to find in the web (see links in a few slides), we will just briefly take a look at some git commands.* `git --version` returns the version of your git. If this command fails, [install git first](https://git-scm.com/downloads).* `git init ` initializes a folder as git repository.* `git clone ` clones a repository for instance from GitHub on your computer.* `git add ` stages specific files or all for next commit.* `git commit -m ""` commits all staged files with a commit message.* `git fetch` fetches changes from remote, for instance new branches.* `git pull` pulls changes form current branch on your computer.* `git push` pushes your local changes to remote on same branch.* `git checkout -b ` checkout `` from remote on your computer.* `git status` lists staged or modified files.* `git log` displays git history.* `git merge ` merges `` into you current branch.* `git revert ` reverts a specific commit.  Exercise:  git (5 minutes)Please follow these steps to become familiar with some common git commands.* Create a folder and navigate with your terminal to this folder.* Type `git init` to initialize the git repository.* Type `git status` multiple times between next steps to see what is going on.* Stage this file with `git add -A`.* Create a file called `file.txt` with the text "Hello git".* Commit this file with `git commit -m "Add first file"`.* Create a branch with `git branch develop`.* Switch to this branch with `git checkout develop` you can see where you are with `git status`.* Change the text in the file into "Hello git, we are on a branch".* Commit this change with `git add -A`, `git commit -m "Adds better text"`.* Switch to master with `git checkout master` and open the file, what text is there?* Merge the changes from develop with `git merge develop`.* View the history with `git log` and the graph with `git log --graph`.  Commit messagesDuring commit, you should add a meaningful commit message with `git commit -m "Your message goes here"` to avoid meaningless git history like in this xdk comic:Good commit messages are well explained in numerous blog posts. One great blog post is from <NAME> and linked in the next code block.<jupyter_code>IFrame(src='https://chris.beams.io/posts/git-commit/#seven-rules', width=1000, height=600)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08206195099398983, 'fraction_numerical': 0.0020804438280166435, 'mean_word_length': 4.561696658097686, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 13, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '26773', 'license': 'MIT', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1057, 'n_words': 621, 'path': '03_software-development/00_git-github.ipynb', 'repo_name': 'FelixBleimund/py-algorithms-4-automotive-engineering', 'size': '4338'}