Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android repo init - how to run non-interactively (or without name/email prompting)

I'm building a script that will download several versions of Android. Rather than pulling each repository from scratch, I'd like to keep a base repository that I can re-init to the right version before syncing (and then copying the result to a safe directory).

However, repo init always prompts for a name and email address, foiling my scripting attempts. I've looked through the repo source and tried options like -q, but it seems like the prompting is coming from the underlying git commands.

Any suggestions on doing a repo init -b without interaction?

like image 573
bhoward Avatar asked Nov 15 '11 03:11

bhoward


1 Answers

Tested solution: If you set user.name and user.email in the global git config, repo will not prompt for your name/email. You can set them by running the following git commands:

$ git config --global user.name 'Warren Turkal'
$ git config --global user.email '[email protected]'

Untested possible solution: I think you can also set those attributes in the manifest repo instead of changing your global config if you only want the name and email to be set for the one repo repository. To do that, you can do something like the following from the repo root:

$ cd .repo/manifests
$ git config user.name 'Warren Turkal'
$ git config user.email '[email protected]'
like image 113
Wren T. Avatar answered Oct 21 '22 20:10

Wren T.