Git · Junior · Question 58 of 75

Why can git pull create unexpected merge commits like "Merge branch 'main' of ..."?

Explanation

If you committed locally and someone pushed meanwhile, the default pull merges them. git pull --rebase (or pull.rebase = true) replays your commits on top instead.

Further reading

Problem with a question

Git · Junior · question 58

Test yourself

Take the Git · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz