On Mon, Apr 17, 2023 at 1:19 AM Uwe Brauer <o...@mat.ucm.es> wrote:
>
> > On Sun, Apr 16, 2023 at 2:31 PM Uwe Brauer <o...@mat.ucm.es> wrote:
>
> > 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
>
> Ah, right. Into my HOWTO file *now*.
>
> But after using the command I obtain
>
> git switch HEAD
> git switch copyright
> git switch default
> git switch documentation
> git switch fontlockhang
> git switch hairyblocks
> git switch mac_init
> git switch modernize
> git switch shellcomplete
> git switch strings
> git switch usage1
> git switch wisent-parser

Those are *suggestions* of what you should run. It doesn't do
anything, and obviously you shouldn't do `git switch HEAD`.

> >   git push hg-remote remotes/origin/modernize:modernize
>
> Well
> git push hg-remote remotes/origin/modernize:mac_init
> error: The destination you provided is not a full refname (i.e.,
> starting with "refs/"). We tried to guess what you meant by:
>
> - Looking for a ref that matches 'mac_init' on the remote side.
> - Checking if the <src> being pushed ('refs/remotes/origin/modernize')
>   is a ref in "refs/{heads,tags}/". If so we add a corresponding
>   refs/{heads,tags}/ prefix on the remote side.

The error message is pretty much telling you what to do:

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

Why didn't you try that?

> > It's not clear what would be the best thing to do here because you
> > haven't explained your use-case.
>
> In the foreseeable feature, matlab-emacs should be moved to
> github/gitlab and I thought of dealing it with your script (BTW I said
> plugin because hg-git calls itself plugin, but since hg is written in
> python that makes sense).
>
> So I have to clone the repository (from gitlab/github and then use your
> script, while using the mirror option would be possible, it think the
> solution with for-each-ref is what I need)

But you can clone it once, set up all the branches once, push all the
branches ini order once, and forget about that step.

After that you can just pull from one repo and push to another.

-- 
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/CAMP44s0Dy8UqSGPVYLYYYxPSu7o7pKQV0L%3DHOa%2Bj8-AtfZuHbw%40mail.gmail.com.

Reply via email to