[git-buildpackage] DEP-14 conversion: what happens if remote renamed branch upstream -> upstream/latest

Guido Günther agx at sigxcpu.org
Tue Aug 12 09:27:07 CEST 2025


Hi,
On Mon, Aug 11, 2025 at 01:46:16PM -0700, Otto Kekäläinen wrote:
> Hi,
> 
> This came up a couple of times in DebConf and nobody has the exact
> answer on their mind, so documenting it here now:
> 
> What happens if I have a git clone of a repository and the maintainer
> renames upstream -> upstream/latest?
> 
> There is a conflict in reference paths and I will get this:
> 
> ± gbp pull --track-missing xxx
> gbp:info: Fetching from 'xxx'
> gbp:error: Error running git branch: fatal: cannot lock ref
> 'refs/heads/upstream/latest': 'refs/heads/upstream' exists; cannot
> create 'refs/heads/upstream/latest'
> 
> This is however very easy to fix, I just run:
> ± git branch -m upstream upstream/latest
> 
> And then the pull works just fine:
> ± gbp pull --track-missing xxx
> gbp:info: Fetching from 'xxx'
> gbp:info: Branch 'debian/latest' is already up to date.
> gbp:info: Branch 'pristine-tar' is already up to date.
> gbp:info: Updating 'upstream/latest': 659ac917b0c2..fc794704e2cd
> 
> As this is a common scenario, maybe git-buildpackage could try to
> handle it automatically?

See https://salsa.debian.org/agx/git-buildpackage/-/merge_requests/53
and the comments there: git 2.50 handles this gracefully.
 -- Guido

> 
> - Otto
> _______________________________________________
> git-buildpackage mailing list
> git-buildpackage at lists.sigxcpu.org
> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage


More information about the git-buildpackage mailing list