Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
StaSh github credentials
-
I'm new to stash, and I can't figure out where to put my github credentials, as it seems git and gh both assume you've already input them somehow. Where are the credentials stored?
-
I have been meaning to push this change to gh:
def setup_gh(): keychainservice='stash.git.github.com' try: user = dict(keychain.get_services())[keychainservice] except: user=input('github username? ') try: pw = keychain.get_password(keychainservice, user) except: pw=console.secure_input('Password?') g=Github(user,pw) u=g.get_user() return g, u
-
that looks like its reading, not storing. Am I missing something?
-
oh you are right... should be storing to that key as well.
btw: I am not sure if current stash git supports clone or pull using passwords... I think probably not. You could try:
git clone https://username:pass@github.com/user/repo.git
but for various reasons this might not work until we replace the existing dulwich implementation. ssh should work for everything, you should probably use ssh if you can, but be aware that ssh push essentially is a force push, and will overwrite github history
-
keychain.set_password(keychainservice, user, pw)
will store the creds
-
I’m a stash noob so apologies if I’m missing something obvious. I’ve got the same issue as @maboesanman. I’m trying to follow @JonB’s advice, but when I type:
keychain.setpassword()
on the StaSh command line, I get the response:
stash: keychain.set_password(): command not found
I’m clearing missing something. Thanks for any help.
-
keychain.setpassword
is a Python function in thekeychain
module provided by Pythonista. You need to use it in Pythonista's Python console, not in Stash. (Also don't forget to runimport keychain
first, so you can use thekeychain
module in the console.)