git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git refusing to merge branches when pulling using a refspec
@ 2023-11-06 17:36 Santiago García Pimentel
  2023-11-06 23:38 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Santiago García Pimentel @ 2023-11-06 17:36 UTC (permalink / raw)
  To: git

Hello,

I'm dealing with a small automation (CI) to synchronise some specific branches between two git repositories.

I need to sync a branch with other using a user-given refspec. e.g.

$ git pull origin "refs/heads/branchOrigin:refs/heads/branchDestination”.

(I’ll have a list of refspecs, but so far Im trying to make it work with one)

When the branch can be fast-forwarded there is no problem, but I cannot manage to make it work when it cant.

I just. get the message "[rejected] branchOrigin -> branchDestination (non-fast forward)."

I've tried  the following:
- adding a git config with pull.rebase=false  (I also tried true)
- adding --no-rebase to the pull command  (I also tried —rebase)

In any cases the result is the same

The issue is, It does work if I just pass the branch names. e.g.

git pull origin branchOrigin --no-edit

merges the branch just fine

Im not sure why git refuses to merge the branches when I pass a full refspec. is this intentional? is there some other incantation I need to use to make this work?

Thank you!

Santiago García Pimentel.
santiago@garciapimentel.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-06 23:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06 17:36 git refusing to merge branches when pulling using a refspec Santiago García Pimentel
2023-11-06 23:38 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).