1

I am creating a nightly build powershell script for an android app. It will behave like this:

  1. Get latest code from github
  2. build the android .apk file
  3. copy that apk file into a builds folder

This script will be run every night by a windows scheduled task.

I'm having trouble with automatically getting the latest code. I am being prompted for credentials. How can I write a nightly build script that includes my credentials so that I dont have type them in every single time?

enter image description here

user952342
  • 2,602
  • 7
  • 34
  • 54

1 Answers1

2

You can add a _netrc file in C:\Users\Ben with your credentials in it:

machine github.com
login yourGitHUbLogin
password yourGitHubPassword

See "Git - How to use .netrc file on windows to save user and password".

If the idea of leaving your credential in plain text doesn't seem a good one, you can encrypt that file with gpg.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. That worked. Although, in that link there seems to be an even easier way which is to just use this tool: https://gitcredentialstore.codeplex.com/releases/view/103679 – user952342 Aug 17 '13 at 18:19