How to save username and password with Mercurial?

后端 未结 8 1818
执念已碎
执念已碎 2020-11-28 00:26

I used Mercurial in a personal project, and I have been typing my username and password every time I want to push something to the server.

I tried adding the followi

相关标签:
8条回答
  • 2020-11-28 01:16

    mercurial_keyring installation on Mac OSX using MacPorts:

    sudo port install py-keyring
    sudo port install py-mercurial_keyring
    

    Add the following to ~/.hgrc:

    # Add your username if you haven't already done so.
    [ui]
    username = email@address.com
    
    [extensions]
    mercurial_keyring =
    
    0 讨论(0)
  • 2020-11-28 01:21

    No one mentioned the keyring extension. It will save the username and password into the system keyring, which is far more secure than storing your passwords in a static file as mentioned above. Perform the steps below and you should be good to go. I had this up and running on Ubuntu in about 2 minutes.

    >> sudo apt-get install python-pip
    >> sudo pip install keyring
    >> sudo pip install mercurial_keyring
    
    **Edit your .hgrc file to include the extension**
    [extensions]
    mercurial_keyring = 
    

    https://www.mercurial-scm.org/wiki/KeyringExtension

    0 讨论(0)
提交回复
热议问题