On Sun, Apr 16, 2023 at 3:01 AM Uwe Brauer <o...@mat.ucm.es> wrote:
> >     git for-each-ref --format='git switch %(refname:lstrip=3)'
> > refs/remotes/origin
> Changing slightly the topic, when I am using your git-hg-remote plugin

git-remote-hg, and I wouldn't call it a "plugin", git doesn't have
plugins. It's just a tool.

> I need to do a lot of pushes from git branch to mercurial named-branches
> like
> git remote add hg-remote hg::../mercurial-matlab-emacs-default
> git checkout strings
> mygit-push-named-branch strings

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

> git checkout modernize

You don't need to checkout a branch to push it.


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 

Reply via email to