please do not only stupidly pull and merge as you like
Pull Fast-Forward instead of simple pull or rebase if you only want to update your local branch
git pull --ff-only has several advantages:
- it doesn't destroy any local merges if already existing ahead the remote (
git pull --rebasedoes)
- it preserves the timeline as straight as possible (only moves the branch pointer, denies update if you have diverged changes)
- it allows you to keep local changes in your working tree unless it conflicts to the pull
Sure: if you already have local commits, you'll need a rebase to keep on track of the lane. But you must not do this, if you have local merges. Then: reset, re-do merge after pull or pull with merge. A rebase will prune your merge and will rebase the merged branch!
use git pull --rebase until you know what you do
most time, you will need
git pull --ff-only
^^ see above
This will overwrite the remote branch with your local branch (history) and will therfor "delete" all commits that are not yet merged in your branch!
So: NEVER DO A FORCE PUSH UNLESS YOU KNOW WHAT YOU'RE DOING!