MASTERING GIT: SQUASH , RESET , REBASE AND MORE..
Git is one of the most popular version control system that allows developers to track changes made to source code and collaborate on software development projects.
Git has a rich set of features and commands that make it a powerful tool for version control and collaboration in software development. Here are some of the most important features and commands:
- Commit
- Branching
- Merging
- Pull
- Push
- Revert
- Squash
- Reset
- Rebase
Some of the important command are Merge, Squash , Reset… etc. I will try to explore more on this commands below.
GIT SQUASH:
Git squash is a command used to merge multiple commits into a single, more meaningful commit. This can be useful for simplifying the history of a branch and making it easier to review changes.
Let me create a workspace and explain the command usage.
$ git status -s
It shows the status of changed files in the repository in a more concise and abbreviated format, making it easier to quickly see which files have been modified and the status of those changes. The first column value A means file is added to staging area.
To view last commits:
$ git show
To view commit history or Summary:
$ git log — oneline
Sample git commit history in visual form:
After merging the new branch with master.
Showing the visual appearance of commit histories after merging.