Skip to content

Instantly share code, notes, and snippets.

@jmcausing
Created October 8, 2019 09:16
Show Gist options
  • Save jmcausing/7358bdff1b961a78098a3e5b791882db to your computer and use it in GitHub Desktop.
Save jmcausing/7358bdff1b961a78098a3e5b791882db to your computer and use it in GitHub Desktop.
Cannot update upstream merged conflict. Error from git pull -Xtheirs git://github.com/pantheon-systems/WordPress.git master:
"Let’s try these steps from your local environment.
1.) Backup the wp-content folder (save it somewhere). Then delete folder that folder.
2.) Reset the site code base (undo commit) to the last applied core updates / successfully update (you can find the commit hash / find something update to Wordpress in the site dashboard -> dev site. -> code). If doesn’t work, find the next successful core updates. See. This guide on how undo commits: https://pantheon.io/docs/undo-commits/ <—
Example:
git reset --hard d2043a0e
d2043a0e is the commit where I was able to update WordPress core in the past.
3.) git pull -Xtheirs git://github.com/pantheon-systems/WordPress.git master
4.) Restore the wp-content folder
5.) git push origin master
6.) If it doesn’t work, force it like git push -f origin master
If that doesn’t try these second batch of steps
*Procedure to undo-commits until to see working upstream updates*
Warning: Doing this will remove your changes, so make sure to make a back-up of your files that does not conflict with core files (/wp-content/* or /sites/all, /modules, /themes)
1. Clone the repository via Git locally. Optional: create a separate branch to test first
2. Run `git log --pretty=format:""%h - %an, %ar : %s""`
3. Look for the earliest commit that can tell upstream updates are still working and get the hash key of the commit
4. Run `git reset --hard <hash-key>` to reach to reset the repo to that commit
5. Push back to the environment as forced: `git push origin <branch> -f`
6. Run upstream updates to the environment and see if it will work
7. In the local Git repo copy, run `git pull origin <branch>` to sync locally the upstream updates that worked
8. Add your custom code back to the repo and commit back."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment