For this question, you can do:
git rebase origin/master
This would help you to resolve your query.
git merge branchname will take new commits from the branch(branchname), and add the commits to the current branch. It can automatically add a "Merge" commit on top.
git rebase branchname takes new commits from the branch(branchname) and insert those commits "under" your changes.
It will modify the history of the current branch such that it is based on the tip of branchname.
git pull is similar to git fetch; git merge origin/master.
git pull --rebase and git fetch are similar; git rebase origin/master.
You start working on a new feature.
when you're ready to push your changes, several commits have been pushed by other developers already.
If you use git pull, your changes will be buried by the new commits, in addition to an automatically-created merge commit.
If you use git pull --rebase instead, git will fast forward your master to upstream, then apply your changes on top.
To learn more about Git and GitHub, you can join Intellipaat's Git training.