> On Mon, Apr 17, 2023 at 3:05 PM Uwe Brauer <[email protected]> wrote:
> git push hg-remote remotes/origin/modernize:refs/heads/branches/modernize
Does not push the git branch modernize to the named branch modernize, sorry
> Only if you don't specify the refspec, which is the typical way to push.
You mean, in layman terms, checkout the remote branch?
> git push hg-remote hairyblocks
> That would be translated to a refspec:
> git push hg-remote refs/heads/hairyblocks:refs/heads/branches/hairyblocks
> But if you are already specifying the refspec, nothing gets translated.
> It does, but you haven't created the local branches, soyou can't do
> `git push foo`, if "foo" doesn't exist.
> But you are going to need to do that only once.
So to sum it up:
1. If I wish to push (remote) gitbranches as hg named branches, I have first
to check them out to have local ones? That seems the strategy I followed
from the
start, but then I understand your comments, that I can somehow
save that step your find at least a faster way
So you suggested
> 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
>
That this would save me to step to checkout the branches, but
git push hg-remote remotes/origin/modernize:modernize
Does not create a named branch.
And concerning
git for-each-ref --format='git switch %(refname:lstrip=3)' refs/remotes/origin
You later told me,
UB> But after using the command I obtain
UB>
UB> git switch HEAD
UB> git switch copyright
UB> git switch default
UB> git switch documentation
UB> git switch fontlockhang
UB> git switch hairyblocks
UB> git switch mac_init
UB> git switch modernize
UB> git switch shellcomplete
UB> git switch strings
UB> git switch usage1
UB> git switch wisent-parser
FC> Those are *suggestions* of what you should run. It doesn't do
FC> anything, and obviously you shouldn't do `git switch HEAD`.
So how should this command help me to avoid checking out each remote
branch.
--
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military.
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/git-users/87h6tdpw04.fsf%40mat.ucm.es.
smime.p7s
Description: S/MIME cryptographic signature
