Open dwy6626 opened 5 days ago
I'm experiencing the same. I've added my logs and versions here: https://gist.github.com/sesponda/11983c0cfbde01ac8374c719a3214404
Can't explain this yet, we need some more information. First of all, what does lazygit show in the branches panel for the test-123 branch? (My guess is a question mark.)
Second, in the log it says that lazygit did git push --set-upstream origin test-123
on the first push, but then right afterwards, git merge-base test-123 test-123@{u}
errored with "fatal: upstream branch 'refs/heads/test-123' not stored as a remote-tracking branch". This is the bit that I don't understand. If you execute those two commands in the terminal (with a new local branch), what's the output?
Hi @stefanhaller, for the 1st question your guess is correct, it shows a question mark. As for running the command in terminal I got these outputs:
> git push --set-upstream origin test-456
branch 'test-456' set up to track 'origin/test-456'.
Everything up-to-date
> git merge-base test-456 test-456@{u}
fatal: upstream branch 'refs/heads/test-456' not stored as a remote-tracking branch
I'm still confused. 😅 Can I ask for more command output?
git for-each-ref --format="%(refname),%(upstream),%(upstream:track),%(push:track)" refs/heads | grep test-
and
git remote -v show origin
(This second command can produce a lot of output depending on how many branches you have; feel free to cut all the information about branches except for your test- branches.)
sure, here are the outputs
$ git for-each-ref --format="%(refname),%(upstream),%(upstream:track),%(push:track)" refs/heads | grep test-
refs/heads/test-456,,,
$ git remote -v show origin
* remote origin
Fetch URL: git@github.com:Houzz/epn.git
Push URL: git@github.com:Houzz/epn.git
HEAD branch: main
Remote branch:
main tracked
Local branches configured for 'git pull':
main merges with remote main
...
test-456 merges with remote test-456
Local refs configured for 'git push':
main pushes to main (up to date)
...
test-456 pushes to test-456 (up to date)
I have absolutely no idea how this can be explained. I asked on the git mailing list, and got a reply from Jeff King (one of the git maintainers, and a real pro), who asked a few more questions. Do you want to subscribe to the list and talk to him directly, or would you prefer me to do that on your behalf? I'm happy to do that if you want, in that case I'd ask you to provide the information he's asking about here.
Describe the bug My branch matches the remote one, but when I use the push command, Lazygit always prompts to force push.
To Reproduce
Expected behavior It should run
git push
for me and without force push prompt.Version info: Run
lazygit --version
and paste the result hereRun
git --version
and paste the result hereAdditional context debug log attached