0

I have two repositories:

~/.gitconfig

[includeIf "gitdir:~/Documents/.repoA"]
    path = .gitconfig-repoA
[includeIf "gitdir:~/Documents/.repoB"]
    path = .gitconfig-repoB

And then, to avoid repeating tokens each time I have to push/pull something, I write this file

.gitconfig-repoA

[user]
    email = emailA@smtp.com
    name = myName
[credential]
    helper = store

.gitconfig-repoB

[user]
    email = emailB@smtp.com
    name = myName
[credential]
    helper = store

But I have to type my token each time yet... How should I do to avoid that?

Paul Serre
  • 457
  • 3
  • 11
  • If you're including `.gitconfig-repoA` why are you storing the configuration data in `.repoA`? Perhaps you should store it in `.gitconfig-repoA`, or include `.repoA`. – torek May 19 '22 at 23:05
  • Sorry I typed too fast. I just updated. – Paul Serre May 19 '22 at 23:21
  • OK - well, if it's using the `store` stuff it should store the credential. That should stick around—though if this is for a single site (e.g., for GitHub) you will need to see https://stackoverflow.com/questions/62730990/save-multiple-password-accounts-for-git here. (I use ssh myself and hence don't use this approach at all.) – torek May 19 '22 at 23:26

0 Answers0