1

I have the same code deployed to multiple remotes (bitbucket and github) so I have to do this every time (which is fine):

git add .; git commit -m "msg"; git push origin master; git push github master;

But the real issue starts here.. First, bitbucket asks me for my token, I supply it, then github asks for both my username and token.. Is there an easier way to save these so I don't supply every time?

I prefer not to set a global git config email, I would rather use a fake email, but I'm OK with any solution, or additional software like a credential manager, or generating a common public key for all repos and somehow storing it and supplying automatically.

I also prefer a solution that doesn't require ssh, but it's OK if it is the only way :)

Thanks!

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
wololoo
  • 147
  • 1
  • 1
  • 9
  • With ssh it's a piece of cake because you can install the same certificate on both hostings.... or even 2 different certificates and have them both _ssh-added_ so that there is no need to specify one or the other when pushing. – eftshift0 Jan 22 '23 at 15:33
  • I'm using other remotes to deploy my node.js app so I'm not sure if they support SSH, but I would really appreciate if you can send an answer about how to do it :) Thanks – wololoo Jan 22 '23 at 16:13
  • Why not set one as a mirror of the other and do the sync with a cron instead to push to several repo ? – Ôrel Jan 22 '23 at 16:21
  • @Ôrel I don't know how to do that either. But I would like to control what I push to which repo. I just want a way to skip supplying the tokens :) – wololoo Jan 22 '23 at 18:33
  • I just found what I was looking for, here: https://stackoverflow.com/a/55472861/14051057 I flagged this question as a duplicate. Thanks for all the help! – wololoo Jan 22 '23 at 18:40

0 Answers0