Already checked those questions:
When should I use git pull --rebase?
Git commits are duplicated in the same branch after doing a rebase
When will `git pull --rebase` get me in to trouble?
but what i don't understand is that some people say that you should always git pull --rebase
and also others went to setting it as a default option when pulling and others said it's creating a problem.
I'm facing the duplicate commits issue in git log and i guess it's because of --rebasing
in the wrong time where we should only pull
, I know that the difference between git pull
and git pull --rebase
is that git pull is trying to merge both local and remote while git pull --rebase replicate the commits.
Scenarios:
- when i start my work and before doing anything new i need to pull other developers changes, should i use
git pull --rebase
or onlygit pull
? and why? - when i work and commit and decide to push but then git asks me to pull first should i use git pull
--rebase or git pull
? and why? - when I work and commit, work and commit (loop) and then in the middle of my work i need someone's else changes before i continue my task should i
git pull
orgit pull --rebase
? and why ?
Thanks