The issue in GitHub


The solution

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.


Thanks for your comment, it resolved the issue. I’d like to comment on this issue as well.

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 repository in GitLab being protected. You can turn that off. More on the protected branches in StackOverflow](https://stackoverflow.com/questions/32246503/fix-gitlab-error-you-are-not-allowed-to-push-code-to-protected-branches-on-thi).
  • 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.