How do PULL keeping HEAD changes?

Asked

Viewed 371 times

0

Some changes were made, commited and there was conflict in some files. If there was no commits made, would resolve as follows:

git stash
git pull
git stash pop

But with commits performed, as can be done a git pull maintaining the changes of head in these conflicts?

  • I don’t know if I understood your doubt right, but if pull, there were conflicts, you solving these conflicts, you continue with the code of the changes, IE, I understand you just need to resolve the conflicts and continue your work.

  • Yes, you just need to resolve the conflicts. But I want an automated way, since in that case all conflicts will be maintained by the local version and discarded the origin.

  • git can make a merge among the new commits that you got by giving pull and its code that was committed locally, but solve conflicts automatically it does not solve.

1 answer

1


I want an automated way, since in that case all conflicts will be maintained by the local version and discarded the origin

Use

$ git pull -s ours

This will resolve conflicts by always prioritizing the local version.

Git Merge Strategies

Browser other questions tagged

You are not signed in. Login or sign up in order to post.