There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lowleveldata ,

I don’t post my code to Github because I still couldn’t figure out how to switch SSH keys for 2 different git servers smoothly.

quantenzitrone ,

you dont have to switch

git will automatically select one that works

I have the same password protected ssh key for every git site i am on tho. The sites only know the public key so its fine.

lowleveldata ,

I don’t know how to switch keys

“just use the same key”

bruh the Stack Overflow energy

Wilker ,
@Wilker@lemmy.blahaj.zone avatar

have at it!

###### taken from Gitlab’s manual page for creating a key, but i wonder what else could be done to expand on it.

<span style="color:#323232;">#~/.gitconfig
</span><span style="color:#323232;">[includeIf "hasconfig:remote.*.url:https://gitlab.com/**"]
</span><span style="color:#323232;">path = /path/to/gitlab.gitconfig
</span><span style="color:#323232;">[includeIf "hasconfig:remote.*.url:https://github.com/**"]
</span><span style="color:#323232;">path = /path/to/github.gitconfig
</span>


<span style="color:#323232;">#example gitlab gitconfig from the included path
</span><span style="color:#323232;">[user]
</span><span style="color:#323232;">name = Your Name
</span><span style="color:#323232;">email = [email protected]
</span><span style="color:#323232;">signingkey = 0000999988887777
</span><span style="color:#323232;">
</span><span style="color:#323232;">[commit]
</span><span style="color:#323232;">gpgsign = true
</span>

if all works well, Git should be able to automatically use the selected key depending on the repo’s stated remote server.

SeerLite ,

That’s GPG, not SSH.

Wilker ,
@Wilker@lemmy.blahaj.zone avatar

my bad x.x

Perhyte ,

If you’re using OpenSSH, the IdentityFile configuration directive selects the SSH key to use.

Add something like this to your SSH config file (~/.ssh/config):


<span style="color:#323232;">Host github.com
</span><span style="color:#323232;">  IdentityFile ~/.ssh/github_rsa
</span><span style="color:#323232;">
</span><span style="color:#323232;">Host gitlab.com
</span><span style="color:#323232;">  IdentityFile ~/.ssh/gitlab_rsa
</span>

This will use the github_rsa key for repositories hosted at github.com, and the gitlab_rsa key for repositories hosted at gitlab.com. Adjust as needed for your key names and hosts, obviously.

dreadedsemi , (edited )

Companies spend a lot of time documenting and reviewing and discussing to release one feature in the meantime you release 100. And if it’s too much spaghetti, you can rerelease new 100.

WorldieBoi ,

And lazy. Maybe that’s why my code is not so good.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines