On Sun, Apr 16, 2023 at 2:31 PM Uwe Brauer <o...@mat.ucm.es> wrote:
>
> > On Sun, Apr 16, 2023 at 3:01 AM Uwe Brauer <o...@mat.ucm.es> wrote:
>
> > git-remote-hg, and I wouldn't call it a "plugin", git doesn't have
> > plugins. It's just a tool.
>
>
> > I'm not sure what's going on here, as I don't have the code of
> > `mygit-push-named-branch`, but I suspect it's doing something like:
>
> >   git push hg-remote strings:branches/strings
>
> > If that's the case I think I already explained to you that you don't
> > need to specify the refspec (strings:branches/strings), if the local
> > branches have the same name as the remote branches, so you should
> > probably name them like "branches/strings", not "strings".
>
> > Alternatively you can configure git to always push local git branches
> > to hg branches:
>
> >     git config remote.hg-remote.push refs/heads/*:refs/heads/branches/*
>
> > So when you do
>
> >     git push hg-remote strings
>
> > It will automatically do the equivalent of:
>
> >     git push hg-remote strings:branches/strings
>
> > Once you have configured git to automatically push to the right
> > location, you can push all the branches with;
>
> >     git push --all
>
> > You don't need to checkout a branch to push it.

>  git branch -a
>
> * default
>   remotes/hg-remote/branches/default
>   remotes/origin/HEAD -> origin/default
>   remotes/origin/copyright
>   remotes/origin/default
>   remotes/origin/documentation
>   remotes/origin/fontlockhang
>   remotes/origin/hairyblocks
>   remotes/origin/mac_init
>   remotes/origin/modernize
>   remotes/origin/shellcomplete
>   remotes/origin/strings
>   remotes/origin/usage1
>   remotes/origin/wisent-parser

You cannot push a branch you don't have. Obviously.

But you can create the branches without checking them out, as I
already explained:

  git for-each-ref --format='git switch %(refname:lstrip=3)' refs/remotes/origin

Or you can push the commit of a remote branch:

  git push hg-remote remotes/origin/modernize:modernize

It's not clear what would be the best thing to do here because you
haven't explained your use-case.

Normally people push their branches, that they have in the their repos.

-- 
Felipe Contreras

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s1%3DmKS9xd69h8bzLcYoTzknM-xPP%3DxbnpqgXWPaUWwjcw%40mail.gmail.com.

Reply via email to