7/22/2020

Software development in automotive sector

Introduction
The automotive business changed a lot during the last decades. Earlier a car was built up from poor hardware, without any software. During the last time there was a huge change: nowadays software is much more important in a car, than the hardware. All big companies are looking for software solutions on challenges, such as autonomous driving or environment friendly driving (E-cars, better engine controllers etc.). And to resolve these problems, there's a huge need for good and efficient software.
I've been working for more than 5 years in the automotive business and I still think that it is a really challenging and innovative area for software developers. Let me give you a better overview.

Software related areas in automotive

There are several areas in the automotive business, where software has a high focus. I will introduce them below, however there are other areas where software is involved and I’m not mentioning them.

ADAS

ADAS is an abbreviation of Advanced Driving Assistant Systems. This involves basically everything which brings the classical, human-based driving in the direction of autonomous driving. Several systems are already available in serial models, like: adaptive cruise control, lane keeping assistance, park assistant systems etc. But additional solutions are expected within the next few years which will enable autonomous driving in different environments (highway, country road, city).
From a software developer perspective these tasks are strongly related to robotics. Based on the inputs of sensors, like radar, lidar, cameras and ultrasonic sensors, by using additional inputs from the map and about the state of the car (current velocity, steering wheel angle etc.) it should be calculated what is the right reaction of the car.
Of course this process is split into several substeps, like sensor information preprocessing, sensor fusion, object prediction, trajectory planning etc.
Usually a lot of mathematics is involved in this area using technologies of signal processing, computer vision or artificial intelligence.
I think this area is maybe the most challenging area of automotive software development.

Engine control

Controlling the engine is done by software, which can be really challenging in the days when saving the environment is in focus and the related standards are very strict. To be able to achieve them very good software solutions are needed.
There’s even a trend of electrical cars. Their engine also needs strong software support to achieve an efficient energy consumption.

Brake control

Nowadays every new has an ABS (Anti-lock Braking System), which is a great software based support to achieve safe braking even in case of high speed or slippery road surface.
Next to that cars have several additional brake assistant systems, like differential scanning calorimetry (DSC) electrical stability control (ESC) etc. These are mostly software based systems, sometimes even with pretty complicated calculations in the background.

Automatic Gears

Automatic gear is also working in a software based manner nowadays. 

Active and passive safety

Another big area is active and passive safety. Let's see what is included here.
Passive safety contains the classical safety features, like seat belts and airbags and pedestrian safety systems as well. Some software is already involved here, but that’s not really the focus here.
Passive safety is more interesting from a software point of view, however it is overlapping with other categories, like ADAS and brake control. It contains all the systems which can help to avoid an accident or just lowering the risks by lowering the velocity before an accident. That involves emergency brake systems, blind spot detection, adaptive cruise control, ABS, ESC, driver monitoring and lane departure warning. These systems require strong software support.
And I think it is really a good goal to work for decreasing the number of accidents on the roads.

Lighting

Modern cars have a proper system to control their lightning to light always with the right intensity to the right direction. To be able to do it some software support is needed, like detection of other light etc.

Infotainment

Classically infotainment contains everything that stands for the communication between the car and the driver, it involves all screens and touch screens, voice recognition, buttons on the cockpit and on the steering wheel etc. It always includes more and more functionalities, like multimedia, navigation, mobile communication etc. Of course these all require great software based solutions.

Navigation

It is a subpart of infotainment, but it is complex enough to mention it separately. Nowaday navigation requires next to great visualization and audio instructions. Also very good localization and path planning based on several inputs. There are challenging cases, like navigation in a tunnel or navigation in complicated, multi-leveled junctions.

Car2car communication

This topic is really pointing into the future, to the world of self-driving cars, but it is already part of our present. In such a system that’s a huge advantage if the cars can communicate with each other, share their planned movements, share what they can see or share their route. Additionally, cars can also communicate with the infrastructure: traffic lights etc. There are already solutions where the traffic light is changing if a bus arrives.
Additionally we can not rely on the internet, since there’s no signal for example in tunnels, so there’s a lot of challenge on the communication layer as well.
As more and more traffic participants start to communicate more and more information it will become a really interesting domain for both big data and wireless network solutions.

Tooling and simulation

Last but not least a huge area in tooling and simulation which is about developing small (and sometimes even complex) programs which can support the developers in activities like testing, simulation, visualization, parameter adjusting etc. At first it can sound easy but in reality it can also be pretty complex, especially if we are talking about traffic and car simulation.

Used technologies in automotive

The software development in the automotive sector is mostly embedded development, except tooling, that’s pure desktop development. Nowadays mobile application development is also part of automotive, since there are more and more situations when our mobile phone communicates with our car.
The core development used to be based on embedded C, but nowadays most companies are changing to use modern C++.
The tool development is mostly done in Python, in some cases in C++ or Java.
Popular frameworks are also used, like OpenCV, OpenCL, ROS etc.
THe model based approaches are also popular, so UML or Simulink is often used in the automotive sector.
Other than that all classical testing methodology is used, like unit testing mocking, higher level testing, software in loop, hardware in loop.
From the domain perspective all knowledge of robotics, computer vision, artificial intelligence or network programming  is welcomed.
Of course up to the project and company this stack may change.

Development process in automotive

The development of the software of a car is done in multiple sections. First usually it starts as a research project. Its goal is to find the right technical solutions. The next step is a pre-serial development, it is still not dedicated for a model, it is a kind of overall solution. And the last step is the serial development, which has the goal to develop a proper software for dedicated models.
However more and more automotive companies are changing to work in a more agile approach, automotive software development is traditionally convervative and strict.
There’s a framework called Automotive Spice which should follow at most of the serial development projects. This framework is very strict and it requires you to document the requirements clearly, link the software design and related code. As well as the test should be properly documented and linked to software requirements and code.

Biggest challenges of automotive software development

Finally I’d like to point out some domain specific challenges.

No bugs in serial software allowed

As the development of the software is done it will be flashed on thousands of microcontrollers (ECUs). Currently most of the OEMs are flashing them manually one by one and there’s no opportunity for remote flashing. That means that to change the software on an already released car requires bringing it to the workshop and reflashing its software. It is of course inconvenient for the customer and costly for the company.
That’s why finding the major bug after the final release is really painful and should be avoided. In order to avoid such situations the testing of the software needs to be done in a really proper way.

Real Time communication network

In a modern car there are really a lot of microcontrollers (ECUs) and several sensors which are communicating with them (cameras, radar, lidar, ultrasonic sensors, wheel impulse counter sensor, rain sensor etc.) The communication between these sensors and ECUs should be really fast in order to avoid shortages which may lead to accidents. Package loss or communication errors are also risky because of the same reason.

Small capacity of processor and memory

The software needs to be written only once, but from the hardware thousands of units need to be produced. It absolutely makes sense to save money on the hardware by using a cheaper processor or a small memory.
On the other hand the software needs to be developed in a way that it is fitting well with this smaller capacity hardware, which can be challenging for the software development team.

Functional Safety

We all know that in a complex system a lot of things can go wrong: sensor failure, communication failures, unknown software bugs, memory failures etc. A car should be able to handle these situations in the right way. It should be able to detect and handle such situations in a safe manner to avoid or reduce such risks as much as possible. In order to do that a standard called ISO26262 should be followed during the whole development process. It provides a methodology to identify and classify the possible failures and to prepare the software to react on them in the best possible way.
Technically these solutions can be based on checking inconsistent inputs and outputs, on using multiple sensors to receive the same input and in certain cases to do the same computation parallel on multiple controllers with different algorithms.

Security

Since the goal of functional safety is to prevent risks caused by the failure of our own system, the goal of security is to prevent risks caused by externals. In the century of computer viruses and hackers it is very important to have a proper mechanism to guard the system from possible manipulations coming from outside, since they could cause serious accidents. This is a new area in automotive which has a really high focus and which involves huge challenges.

Summary

After more than 5 years as a software developer in the automotive business I see this area as a really challenging area, which needs more and more software developers. If you are considering changing your domain don’t forget about automotive.

6/15/2020

Tools Every Freelance Programmer Needs

Freelancers represent the fastest growing professional group of our time. While freelancing has always been an alternative for 9-5 jobs, creative professionals such as writers and web designers have started leaving their jobs in droves. Most of the work done by programmers, web designers, and other creatives can be done more quickly, thanks to advancements in technology. Additionally, there are apps designed to help these professionals work remotely. 
So, why bother working behind a desk when you can from your laptop anywhere in the world? With many companies now choosing to work with freelancers to avoid the hustle and bustle of having to hire permanent employees, it’s easier for gig workers to find work these days. As an added advantage, you get to choose your clients, projects, and schedules when working as a freelancer. But it’s not all sunshine and lollipops in the world of freelance. 

Essential Freelancing Tools for Programmers
From taxes, cashflow problems, and a mountain of administrative tasks to deal with, you will face a lot of challenges as a full-time freelancer. Sometimes, you need to keep track of multiple clients and projects, which can take a significant amount of time. Luckily, there are tools designed to help you manage yourself and find time to focus on writing code. Here are some of the best freelancing tools for programmers. 

Trello
Trello is a must-have tool for every freelancer out there. When working as a freelancer, sometimes you will need to chip in with your client’s team or collaborate with other professionals in your line of work. Trello is one of the best collaborative tools out there. On top of that, Trello is an excellent personal organizer and project management tool. If you are a list maker, you can use the application to organize any tasks you have and save on time. 

Visual Studio Code
Visual Studio Code has become quite sought-after among programmers in the last few years. This source code editor from Microsoft can be used with most programming languages and is easy to fit around your style of working. Visual Studio Code is designed to work quickly and conveniently to get you through the code debug cycle. In addition to debugging, Visual Studio Code also caters for code snippets and supports intelligent code completion. This hand programming tool works on Windows, macOS, and Linux. 

Codepen
Created by a group of full-stack developers in 2012, Codepen is a virtual code editor and open-source learning environment for testing and showcasing code snippets. Here, developers can create HTML, CSS, and JavaScript code snippets — known as ‘pens’ — and test them. Freelancers can use Codepen to share progress with their clients or try out new ideas and receive feedback on problems they are experiencing from community members. With about 17 million visits per month, Codepen brings people together with the goal of improving both users and technology. 

VPN
A Virtual Private Network (VPN) encrypts the traffic passing through your local network, allowing greater privacy online. A VPN with a no-logs policy leaves little to no digital traces online and therefore less material for hackers and potential hackers. Some VPNs have malware-killing features.  VPNs are also useful when it comes to bypassing geographical restrictions. All these features are useful for freelance programmers. For a freelance programmer, downloading a VPN for extra protection is one of the most effective ways to mitigate cybersecurity risks. 

Being a freelance programmer can be demanding. In addition to the endless list of administrative tasks, you have to deal with on the daily, staying on top of deadlines when working with multiple clients can be challenging. Fortunately, there’s a vast array of freelancing tools you can use to organize yourself and perform these tasks quickly. These tools will help you save time and focus on writing code. 



This article was a guest post from TOVPN Organization:

#TurnOnVPN is a non-profit organization focusing on a free and unimpeded internet for all. We take part in numerous online events, aimed at promoting a safe, secure, and censor-free Internet. Learn more at www.turnonvpn.org/blog/.

5/18/2020

Advanced GIT Tutorial - How to debug your code with GIT?

Introduction

Unfortunately every software developer knows that things are often going wrong. Something breaks the build, something else breaks the tests. Someone makes changes which don’t fit with the coding guidelines etc.
It can be pretty difficult in such cases to figure out what went wrong, long long hours and days of debugging is needed sometimes.
Fortunately git can also help in such situations. Let’s see some builtin git commands which can make your life easier if something went wrong in your project.

Figure Out, Who Introduced The Guilty Line

You are reading a code and you find a line. “Who the hell did it?” - this is your first question. Maybe you don’t understand the purpose of the line or it is not following the coding guidelines or it is the root cause of a bug. The first thing that you can do is to check the git log for that file and figure out which commit contains the relevant change. It can be time consuming, especially if there’s a long history of the file and the relevant change happened long back in the time.
There’s another, more efficient solution: git blame.
Just type git blame filename. It will show you for each line, which commit was the last one that modified it.
This way it is pretty easy to figure out who did the change and what was its purpose.

Find The First Broken Commit

You found a bug in the code. You know that a week ago it was still not present and you don’t know the exact root cause yet. It would help a lot if you knew which commit introduced the bug, you could save a lot of debugging-time.
Git bisect is the best solution in this situation. Git bisect is a binary search method in your commit history. It can even handle the merge commits. Let’s see how it works:
  1. Type git bisect start - It starts the bisect process
  2. Type git bisect bad - It marks the current commit as “bad”
  3. Type git bisect good hash_of_the_last_working_commit - Mark “good” the last commit where you are sure the bug was not present
  4. Now git bisect will checkout a commit which is between the current and the last good commit. Compile it and test it. If the bug is present type git bisect bad, otherwise git bisect good.
  5. Repeat step 4 until you can’t find the commit
Thanks for the power of binary search, it is a pretty fast method to find the guilty commit.
It can cause issues with this method if the bug is not consistent, it randomly appears in some commits.

Automatize The Search Process

It can be time consuming to test the commits manually.
Fortunately it can be automated. Git bisect also supports running automated tests.
  1. Implement a test which return 0 if the bug is not present and non zero if the bug is present (most of the test frameworks already works in this way, so it is enough to implement some simple unit test in most of the cases)
  2. Type git bisect start
  3. Type git bisect bad
  4. Type git bisect good hash_of_last_working_commit
  5. Type git bisect run your_test
This method will find the first commit where your bug is present.

Summary

Both git blame and git guilty can be very useful in situations when you have to figure out what is the root cause of a bug. It can be much faster than using a classical debugging approach, given that you committed frequently enough.

4/23/2020

How can COVID change the life of programmers?

During the last months the whole world changed a lot. Something happened that was not expected at all. The schools closed in most of the countries and a lot of courses have been started. Most of the companies changed to home office mode or closed down. Anyway, digital solutions have a high role in the current situation. The companies with a good digital background can survive, the rest can easily fail.
Fortunately most of the software companies have a good digital background. But how will this situation influence the life of programmers in the long term?

Finally we can do home office

At most of the companies the opportunity of home office is a big ghost since years. Even if there are no technical obstacles or they could be removed by a simple IT solution (like setting up a VPN bridge etc.), a lot of companies still had a policy of no home office or very restricted rules for home office (like only once a month etc.). In most of the cases they had the impression that working from home is not efficient. Or they just wanted to track their employees more strictly and easier.
At most of these companies it changed now and they changed to an almost 100% home office mode. Which means most of their employees in most of their time are working from home.
I’m sure that on one hand there are companies and projects who are more successful on this change, on the other hand some companies may fail this change.
The reason for failing can be the lack of trust from management point of view, wrong leading strategies in the company, pure technical infrastructure, lack of experience or lack of motivation from the developer side.
But based on what I’m experiencing and what I heard from others at most companies this change was more or less successful, the teams are working from home with similar efficiency as they had before.
From the developer side there are also different opinions. There are ones who hate working from home. For some of them the conditions are not fulfilled at home properly, others are just too social to do it on a daily basis.
But, at least from the ones I know, most of the developers like this situation from a work perspective. I personally also like it, but I would prefer to work from the office once or twice a week.
The other point I often heard is that some of the developers have difficulties to find the work-life balance at home and they are working much longer than normally. You have to be strict with yourself to manage it properly.

What will happen to our projects?

Another perspective is the perspective of the customers. Since a lot of businesses stopped working during the last weeks, for sure there will be a lot of projects cancelled by the customers. On the other hand there are fields where there's a huge need for software developers: online communication and education solutions, digital solutions for shops and services etc.
So I also expect a lot of new projects coming in the near future. However all of us need to be flexible, it can happen that we have to change our profile a bit and to change domain or technology in the future.

What comes after Corona?

As for now most of the well-paying developer jobs are placed in big and expensive cities and expensive countries.
At these places even if you have a good salary you don’t have a huge chance to have your own house in a calm circumstance with a nice garden, these places are mostly too crowded for that and the prices are too high. Furthermore a lot of developers are working far from their home, just to have a proper job.
In the current situation there’s a good chance that companies will realize that home office work can still be efficient and they can save a lot of costs on that (like renting office space etc.), so they are changing fully or partially to this mode in the future.
I already heard some nice visions from programmers about moving to the countryside or back to their hometown and doing the same job for the same salary remotely.
It sounds great, but I doubt if it could work so easily.
If you take a look at how most big companies are working nowadays: they have headquarters and offices in more expensive countries, near to their customers and they have offices in so-called best cost countries (like India, eastern-European countries etc.). The reason is that it is enough to pay much less (sometimes even around 25%) in the best cost countries, than in the expensive ones (US, UK, Germany etc.). But they still want to have a certain amount of employees who are there in place, who can meet any time with the customer, who can be tracked better, who are near to the fire.
So if you are working now at an expensive and well-playing place and you are changing to 100% home office mode and moving to some nice, preferred place your advantage over the colleagues working in the so called best cost countries will be strongly reduced. So that it isn't worth it for your company to pay you 3-4 times more than for your colleagues working in the low cost offices. So most likely they won’t do it in the long term.
On the other hand the disadvantage of being far away from the headquarter will be also reduced if more and more work is done remotely. It makes no big difference if you are working from home in the next street or 2000 kilometers away.
That means if the home office model will become more and more popular I expect the differences of salaries between the different countries to be reduced in the long term.

How to make the most benefits from the situation?

How can we handle this situation?
First of all I have to remark, that we are very lucky compared to other professions, since our job can be easily done from home, so we are not stuck without incoming for weeks or months. On the contrary, we can save some time by not having to commute to work everyday.
One hand we have to do our best for our current work and current project to show that we are efficient developers even from home office.
In order to do that you have to have a strict daily routine and you may have to try out new tools or new ways of working. For example we started to do only mob-programming sessions and I think they are really useful.
On the other hand in your free time you have to learn something new, so that you will be flexible enough to change if it is required in the future. Take a look at the trending technologies and domains. There are now a lot of online courses available for free or for a discounted price. Do them, it makes you really powerful in the long term!

4/03/2020

Software quality assurance in practice

Introduction

Every software developer has some idea of a good quality project (bug free, fast, easy to adapt, readable code base etc.). Some of the developers also have an idea how to achieve it (reviews, TDD, proper design, proper testing etc.). All these practices need to be collected and followed is a way.
Software quality assurance is something that is on the side of any development, regardless of the development process. Some way of quality assurance is used by all big companies. The goal of software quality assurance is to have a clear picture about the quality and try to reach and maintain a predefined level of quality.

Theory of software quality assurance

Most of the companies have a dedicated quality assurance team or at least one dedicated person who is responsible for the quality of the projects. That means it should be someone who is not involved in the project, who makes no development on that, this person rather makes sure that the development team does everything in the correct way. Quality assurance is involved in each and every step of the development process: planning and tracking of the project, requirements engineering, software design, implementation and testing.
The very first point is to set up rules to be followed by the whole development team: how should a requirement be documented, which level of software design is required in which situations, who and how should review the work, which coding guideline is to be followed etc.
Once it is done the role of the quality team is to make sure that during the project everyone is following the predefined rules. To be able to achieve it the activities should be documented in a clear way. For example, if someone did a review of a piece of code it should be documented in a way, that it can be always proved later that the given version of the given code has been reviewed.
There are predefined software quality standards and frameworks, like the different versions of SPICE or CMMI, which have several predefined rules, but every project and organization is free to set up their own ruleset.

Software quality assurance in practice

Setup rules and performance indicators

In practice the very first step to set up the rules for the development: coding guidelines, testing guidelines, responsibility matrices etc.
Some of them should be introduced right at the beginning of the project. But introducing all of them at the beginning can really go against performance and the success of the project. So some of these rules can be introduced in a later stage of the project.
Some of these rules are pretty binary: either they are followed or not. Like the rules in the coding guideline: “don’t use variable names longer than 15 character”. It is very easy to decide if this rule is followed or not.
There are other cases where the answer is not so clear. A good example is test coverage. Most of the projects require unit tests, but it is not needed that each and every line is covered by these tests. In these cases so called key performance indicators (KPI) should be set up. This thing should be quantified and measurable. For example for code coverage there are multiple possible KPI’s: line coverage, branch coverage, etc. It should be decided what is the official measurement method in the project.
These rules can be relevant for any step of the development (planning, requirements, design, coding, testing etc.).

Measure your indicators

Once we know the rules to be followed we have to figure out a way to measure them. The best way is if we can automate these measurements by some tools and integrate them to the continuous integration system of the project. So that you will have continuous feedback about the state of the project, you can follow how its quality changes. It is good practice to introduce these KPIs to the whole team. Most of the tools which can do the measurement on different KPIs are easy to integrate, in other cases you can use some scripts to do the job.

Setup goals

Once the KPIs are measured and known by the team setup some goals. Like “the code coverage should reach 80%” or the number of compiler warnings should be 0, every component has to be linked to requirements etc. Let the team know these goals and let them work on them. Give regular feedback to the team about the distance from the goals and the achieved changes. It can be done by daily report emails. All these goals need to be documented in a clear way.
The most typical goals are the following:
  • Design has to be linked to requirements
  • Code needs to be linked to design
  • Positive review should be done before merging
  • Test should be linked to requirements
  • Coding guidelines should be followed. (for that a proper coding guideline is required)
  • Code should be covered by tests
  • Memory assumption/runtime should be in a dedicated range
  • The piece of change (commit) should be connected to a ticket in the ticket system
  • Tickets in the ticket system should be connected to requirements

Setup gates

Finally, you can set up some built-in gates to the CI system. That means it doesn’t allow to merge code which is violating any of the rules, like: contains compiler warnings, failing some checks, not covered by tests, has failing unit tests etc. This can reduce the speed of development, but increase its quality.
In general too strict rules can be against productivity, pay attention! You should always pass the rules to the project needs. So most likely the expected quality in case of a mobile game will be much lower than in the case of an aeroplane software.

Summary

Quality assurance is nothing complicated. I tried to describe it in a practical manner and not in a principled way. But one thing is important: you have to be strict, the rules which have been set up, need to be followed.

3/12/2020

Advanced GIT tutorial - Interactive rebase

Introduction
It can often happen that you did something wrong by using GIT: you gave the wrong commit message, created too few or too many commits, you have commits in the wrong order or with the wrong content. To change such things you have to change history in GIT. Interactive rebase in GIT is an efficient and powerful tool for that.

The idea of interactive rebase

Git rebase can change the commits between the current HEAD and a dedicated commit. You can define the commit either by its hash or by its index relative to the current HEAD by giving HEAD~n, where n is the index. So HEAD~10 means the 10.th commit before the current HEAD.
To change the last 3 commits before the current HEAD type git rebase --interactive HEAD~3 or git rebase --interactive hash_of_the_third_commit_after_head. Pay attention, the third commit after HEAD is practically the fourth commit in git log, since the first is the HEAD itself. Instead of --interactive you can also type -i. This command will open your default editor and list your last three commits. The format is something like:
pick hash_id commit_message for each commit.
The very first thing you can do is to change the order of the commits in this file. It is pretty straight-forward, just change to order of the lines
Other than that you have the following options with each of the commits:
  • Pick (p): You would like to keep that commit as it is, this is the default action.
  • Reword (r): You would like to change the commit message of the commit.
  • Edit (e): You would like to change the content of the commit
  • Squash (s): It merges the commit with the previous one, keeping both the commit messages
  • Fixup (f): Same as squash, but it keeps the commit message of the previous commit
  • Exec (x): Executes a custom shell command
  • Break (b): It stops the rebasing at that commit, you can continue later with git rebase --continue
  • Drop (d): It drops that commit together with its content. That’s the best way of getting rid of a commit
  • Label (l): It attaches a label to the given which is the actual HEAD: Pay attention! The parameter here is not a commit id.
  • Reset (t): It resets the label of the current HEAD commit. It is also not expecting a commit id.
  • Merge (m): It creates a merge commit.
You should just write the right keyword or its abbreviation (in brackets) before he commit id.

Resolve issues by interactive rebase

Here is a small collection of real life scenarios which can be resolved by interactive rebase.

Change commit order

As already mentioned, you can change the order of the commits. If you want to change the order of the last 10 commits:
  1. Type git rebase --interactive HEAD~10
  2. You  see now the list of commits is your default editor. Change their order as you wish.
  3. Save this file, resolve all conflicts
There’s a huge chance that you have to resolve some rebase conflicts, in this case change them, add the changed file with calling git add and type git rebase --continue at the end. Since the rebasing is commit based it can be that you have to fix similar conflicts in the same file multiple times.

Get rid of unnecessary commits

It can happen, that you would like to remove a commit with its content, do the following:
  1. Type git rebase --interactive HEAD~10 (to remove some commits from the last 10)
  2. Change the “pick” to “drop” in the lines of commits to be removed
  3. Save the file and resolve the conflicts
That’s it, you removed the unnecessary commits with all their content.

One commit instead of multiple commits

Sometimes you created too many simple commits and you would like to make your history more clean with less commits. You can simply merge the content of multiple commits into one.
  1. Type git rebase --interactive HEAD~10 (to merge some commits from the last 10)
  2. Change the “pick” to “fixup” in the lines of commits to be merged into the previous ones
  3. Save the file

Change the commit message of old commits

What to do if you want to change the commit message of an older commit?
  1. Type git rebase --interactive HEAD~10 (to change the message of some commits from the last 10)
  2. Change the “pick” to “reword” in the lines of commits to be renamed
  3. Save the file
  4. The current commit message will appear in your editor, change it and save it

Edit an old commit

How to change the content of an older commit?
  1. Type git rebase --interactive HEAD~10 (to change some commits from the last 10)
  2. Change the “pick” to “edit” in the lines of commits to be edited
  3. Save the file
  4. Do the changes you want, add them by git add and commit them by git commit --amend
  5. Type git rebase --continue
  6. Resolve all the conflicts

Split commit

How to split an already existing commit?
  1. Type git rebase --interactive HEAD~10 (to split a commit from the last 10)
  2. Change the “pick” to “edit” in the lines of the commit to be splitted
  3. Save the file
  4. Type git reset
  5. Add the changes for the first commit and commit it
  6. Add the changes for the second commit and commit it
  7. git rebase --continue

Summary


In my view interactive rebasing in git is a very powerful option which can make several scenarios easier and faster. But in order to use it in an efficient way you have to really know how it works.

Software development in automotive sector

Introduction The automotive business changed a lot during the last decades. Earlier a car was built up from poor hardware, without any s...