git merge, rebase
git merge
3-way-merge

When each branch has one or more new commits, if you run the git merge command, it automatically creates a new commit by combining the code from both branches β basic operation method of merge
fast-forward merge

Sometimes there are commits only in the new branch and no new commits in the base branch, when you merge, it's called "fast-forward merge". This means there's nothing to merge, so it tells the new branch "from now on you are the main branch". Of course, the result is the same as 3-way merge
git rebase & merge

Moving the starting point of a branch to another commit Move the starting point of the new branch to the latest commit of the main branch using rebase, then do fast-forward merge
git switch {new branch}
git rebase main
git switch main
git merge {new branch}
git squash & merge

Stage files to be committed by moving them from working directory to staging area
git switch main
git merge --squash {branch name}
git commit -m 'message'
Last updated