> 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.


Well that this is not my case. 

I just tried that (after running 
git remote add hg-remote  ../mercurial-matlab-emacs-default/
git config remote.hg-remote.push 'refs/heads/*:refs/heads/branches/*'


git push hg-remote modernize


error: src refspec modernize does not match any
error: failed to push some refs to 
'hg::/home/oub/Push-test/mercurial-matlab-emacs-default'

 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

So it seems that in that case I need to checkout the branches, right?

Indeed 

After 

 git checkout modernize
git push hg-remote modernize


It worked  
 

-- 
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 git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/877cuby681.fsf%40mat.ucm.es.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to