Can't update Kirby submodule via git

Hi there,

in my project I have installed Kirby as a git submodule, as described in the Kirby meets Git recipe.

If I recall correctly, this has worked in the past. However, now I noticed in my panel that my Kirby version was still 3.2.3, so I wanted to update it. I exactly followed the steps described in the update section of the recipe.

However, my terminal gives me this output:

ws-83-167:kirby timo$ git checkout master
Already on 'master'
Your branch is behind 'origin/master' by 573 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
ws-83-167:kirby trych$ git pull                                                                                                                                                                                                                                              
remote: Enumerating objects: 199, done.                                                                                                                                                                                                                                     
remote: Counting objects: 100% (199/199), done.                                                                                                                                                                                                                             
remote: Compressing objects: 100% (2/2), done.                                                                                                                                                                                                                              
remote: Total 252 (delta 197), reused 199 (delta 197), pack-reused 53                                                                                                                                                                                                       
Receiving objects: 100% (252/252), 67.66 KiB | 624.00 KiB/s, done.
Resolving deltas: 100% (198/198), completed with 105 local objects.
   ec44e6b..4149470  develop                                -> origin/develop
 * [new branch]      feature/dependency-upgrade             -> origin/feature/dependency-upgrade
 * [new branch]      feature/filecache-root                 -> origin/feature/filecache-root
error: cannot lock ref 'refs/remotes/origin/features/2368-search-component': 'refs/remotes/origin/features' exists; cannot create 'refs/remotes/origin/features/2368-search-component'
 ! [new branch]      features/2368-search-component         -> origin/features/2368-search-component  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/features/2374-api-auto-match': 'refs/remotes/origin/features' exists; cannot create 'refs/remotes/origin/features/2374-api-auto-match'
 ! [new branch]      features/2374-api-auto-match           -> origin/features/2374-api-auto-match  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/features/file-search': 'refs/remotes/origin/features' exists; cannot create 'refs/remotes/origin/features/file-search'
 ! [new branch]      features/file-search                   -> origin/features/file-search  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/features/interval-field': 'refs/remotes/origin/features' exists; cannot create 'refs/remotes/origin/features/interval-field'
 ! [new branch]      features/interval-field                -> origin/features/interval-field  (unable to update local ref)
   715d3f6..0337c31  fix/2372-float-decimals                -> origin/fix/2372-float-decimals
 * [new branch]      fix/2418-route-after                   -> origin/fix/2418-route-after
 * [new branch]      fix/2426-locale-constants              -> origin/fix/2426-locale-constants
 * [new branch]      fix/2430-improve-translateCount-method -> origin/fix/2430-improve-translateCount-method
 * [new branch]      fix/view-mobile-scale                  -> origin/fix/view-mobile-scale
 * [new tag]         3.3.3-rc.1                             -> 3.3.3-rc.1

So there is a few errors in there. And when I do a git status after that, it still claims that my branch is behind 573 commits and in the panel it still shows Kirby version 3.2.3.

Does anybody know what is going wrong here and could help me?


Ok, it seems my submodule got messed up. I found the solution on Stack Overflow:

git remote prune origin

This cleaned up my submodule and allowed me to update as expected again.

1 Like