On Sun, Apr 16, 2023 at 6:15 AM Uwe Brauer <o...@mat.ucm.es> wrote:
>
> >>> "FC" == Felipe Contreras <felipe.contre...@gmail.com> writes:
>
> > 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
> >>
>
> > git-remote-hg, and I wouldn't call it a "plugin", git doesn't have
> > plugins. It's just a tool.
>
>
> Ok.
>
>
> >> 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:
>
> Sorry it is an alias.
> >   git push hg-remote strings:branches/strings
>
> Precisely.
>
>
> > 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/*
>
>
> Well that does not work it gives be the following error.
> git: No match.

At which time? When you do `git config`? Then it's probably your shell globbing

    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
>
> But what's about the correct order, I mean shall I push master first
> then the others, or those which (approximately) were created first?

It depends on your topology, "master" most definitely you should push
first, but perhaps only the first time.

If you have branches with commits in common, for example:

  master
  |
  *--*---* topic-a
      \
       *-* topic-b

Then you would need to push one before the other (the first time), in
this case presumably topic-a, since topic-b branched off from topic-a.

> Because I do remember in one mail you said the order which branch to
> push first is somehow important, or I misunderstood you.

Yes, if you are creating a new repository by pushing branches, it does
matter the first time.

Cheers.

-- 
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/CAMP44s3OWDEm4yaXbXu07GJ644ekwSZkUKGqXHXzRRG%3DQonmvw%40mail.gmail.com.

Reply via email to