passforios icon indicating copy to clipboard operation
passforios copied to clipboard

Can't sync due to Merge conflct GTGitErrorDomain error -13

Open alpiua opened this issue 3 years ago • 6 comments

Having message: Merge conflict. The operation couldn't be completed. (GTGitErrorDomain error -13). Was able to sync only by removing local changes. Is it a way to know, what entry have an error preventing me from commit ?

alpiua avatar Aug 20 '22 14:08 alpiua

The is no way to see which file caused the conflict in the app at the moment. Merge conflicts can only be resolved by resetting the changes in the app or with access to the hosting repository and some manual action.

SimplyDanny avatar Aug 22 '22 21:08 SimplyDanny

I just dealt with this issue, so I will share how I resolved it. Perhaps this can help with the documentation as well.

I resolved the issue by returning the master branch of my password-store to a point where the ios app could successfully update and then I rebased the subsequent history back onto master.

Suppose I want to merge into a git history that looks like this:

$ git log --pretty='format:%C(auto)%h (%an)'
c1fcf2d (Martin Miller)
...
f93a9a2 (Martin Miller)
ad637d7 (marty ios)
1635056 (marty ios)

I can identify the last IOS commit. The app should be able to merge onto that commit conflict-free. Let's use rebase to inject our IOS changes at that point in the history and then re-apply the subsequent changes on top of that.

On a PC I run the following commands:

$ git fetch
$ git checkout -b old-master origin/master # store the existing master in a temporary branch
$ git checkout master # return to the master branch
$ git pull # update the local master branch to match the remote
$ git rebase -i ad637d7 # Select the last ios commit here
# drop all commits after the last ios commit
$ git push -f origin master # force push the updated history

After you have dropped all commits after the last ios commit, try again to update on your phone. The ios pass app should update successfully.

Now we need to restore the subsequent changes. You may have to reason through some conflicts.

$ git fetch # once again we update because the ios app has added new commits
$ git checkout old-master
$ git rebase origin/master
... # resolve conflicts
$ git push origin old-master:master # push old-master into master

Once again update the ios app and you should be all set.

presocratics avatar Nov 24 '22 17:11 presocratics

Thanks for your comment @presocratics, it resolved the issue for me.


A couple of additions from me.

First, needed to be said there’s no such a problem in the Android app. There’s different buttons: pull, push, sync. If there’s a problem with sync, pull before that never failed for me. If there’s no way to solve the issue in this particular app, adding the relevant buttons could simplify things significantly.


Second, I’d like to comment on the latest — very helpful indeed! — comment.

  • I had my pass repository in GitLab being protected. You can turn that off. More on the protected branches in StackOverflow.
  • I had no merging conflicts. For me personally, it’s usually I interact with different passwords while on a mobile. Either I add new ones, or correct the existing ones without touching them later on a PC. But if I had, I may not know how to fix that, as I’m not very skilled with git. I’m just skilled enough to use it for my daily tasks.
  • This broke my pass git push command, as I had two branches: master and old-master, with the latter becoming my primary one. I needed to do two extra steps:
git checkout master
git merge old-master

After that my iOS app works well back again. So this workaround is very helpful till the issue is resolved.

walteweiss avatar Jan 06 '23 08:01 walteweiss

If you mostly use the app to read passwords, and have few to none uncommitted passwords there, there is an easy route:

  • Save any uncommited passwords from the iOS app by adding them to the repository from another device.
  • Settings > Password Repository > Clone. This overwrite the current data in the iOS app and gives you a fresh start.

qtpies avatar Apr 12 '23 16:04 qtpies