Reputation: 86185
I have both local changes and remote changes.
Someone told me I must do push first, then pull. Any reason behind this?
Upvotes: 16
Views: 11150
Reputation: 12561
That person is wrong: the right model is pull-before-you-push
and not the reverse.
When you pull
, git
will fetch commits on origin
and will try to fast-forward
your local commits on top of them, doing the merge. After that you can push
in this way you will not generate conflicts with other updates.
Upvotes: 41