- What is linear view of history?
- How to maintain linear history in git?
- Is history linear or non linear?
- Why do we need linear history?
What is linear view of history?
Those who claim to be linear believe that there is a chain of events written in chronological order, and the events that happened in the past are very unlikely to take place in the future.
How to maintain linear history in git?
In order to have a more linear and meaningful git history, we should try to prefer rebased commits and also we shall squash all commits present in a PR. This would improve the readability of the git history and contributors do not need to manually clean up their commits when the PR is ready.
Is history linear or non linear?
While historians have the privilege of working with hindsight, there is no hindsight of the future. From the historian's perspective to the past, however, everything is linear.
Why do we need linear history?
Require linear history
Enforcing a linear commit history prevents collaborators from pushing merge commits to the branch. This means that any pull requests merged into the protected branch must use a squash merge or a rebase merge. A strictly linear commit history can help teams reverse changes more easily.