The git commit command captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to.
Git rebase gets all unique commits from both branches and applies them one by one. Git rebase rewrites commit history but doesn’t create an extra commit for merging.