Rebasing and merging are both designed to integrate changes from one branch into another branch but in different ways.
If you have a feature branch，
REBASE: you want to rebase the feature branch onto master branch, you move the feature branch’s base to masters’. If you have conflicts, it will present conflicts per commit, so you may end up resolve conflicts multiple times. It completely rewrites the history.
MERGE: you want to merge the feature branch onto master branch, you take the content of commits and integrate onto master branch. It creates a new commit for the merge, and you can resolve the conflicts and add a commit message. It preserves the history.
If you work in a large development team, I recommend to use merge, as it preserves the history and everyone is aware of what had happened in the past. If you have a fairly complicated history and you want to squash the commits, then rebase is a good option to do so.
If you are new to git and this book would help you with useful tips and techniques to work better with your development team.
I also design developer memes on Tshirts & stickers.
if you have the same taste of dev humour and enjoy the designs please support me at redbubble =)