omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    github git shell stash
    4
    7
    5444
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • maboesanman
      maboesanman last edited by

      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?

      1 Reply Last reply Reply Quote 1
      • JonB
        JonB last edited by

        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
        
        1 Reply Last reply Reply Quote 0
        • maboesanman
          maboesanman last edited by

          that looks like its reading, not storing. Am I missing something?

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            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

            1 Reply Last reply Reply Quote 1
            • JonB
              JonB last edited by

              keychain.set_password(keychainservice, user, pw)

              will store the creds

              1 Reply Last reply Reply Quote 0
              • msteen
                msteen last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • dgelessus
                  dgelessus last edited by

                  keychain.setpassword is a Python function in the keychain module provided by Pythonista. You need to use it in Pythonista's Python console, not in Stash. (Also don't forget to run import keychain first, so you can use the keychain module in the console.)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors