How to prevent that the password to decrypt the private key has to be entered every time when using Git Bash on Windows?

后端 未结 7 2133
南方客
南方客 2020-11-28 17:20

I\'ve an automatic building service which download from a git private repository. The problem is that when it tries to clone repository it need to provide the password, beca

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 18:09

    The right solution is:

    1. Run the Windows default terminal - cmd and get the directory of your master profile

      echo %USERPROFILE%
      
    2. Run Git Bash in the directory above and create the .bashrc file with the command

      echo "" > .bashrc
      
    3. Open the .bashrc file with your favourite text editor and paste code from GitHub Help into that file:

      env=~/.ssh/agent.env
      ...
      COPY WHOLE CODE FROM URL - I can't add it to Stack Overflow because it breaks layout... OMG!
      
    4. Restart Git Bash and it asks you for your password (only first time) and done. No password bothering again.

提交回复
热议问题