Android repo init - how to run silently (or without a hint by name / email)

I am creating a script that will download several versions of Android. Instead of pulling each repository from scratch, I would like to save the base repository, which I can restart to the correct version before synchronization (and then copy the result to a safe directory).

However, repo init always asks for a name and email address, which deprives me of scripting attempts. I looked at the source of the repo and tried options like -q, but the hint seems to come from the basic git commands.

Any suggestions on doing init -b repo without interaction?

+4
source share
2 answers

Tested solution. If you specify user.name and user.email in the global git configuration, the repo will not ask for your name / email address. You can install them by running the following git commands:

$ git config --global user.name 'Warren Turkal' $ git config --global user.email ' wt@example.com ' 

Unrepresented Possible Solution. I think you can also set these attributes in the repo repository instead of changing the global configuration if you want the name and email address to be set for the same repo repository. For this you can do something like this from the root of the repo:

 $ cd .repo/manifests $ git config user.name 'Warren Turkal' $ git config user.email ' wt@example.com ' 
+3
source

Why not just use git yourself? This is a more convenient scenario. git archive pipe for exporting tar or git --work-tree=where/you/want/the/files checkout tag_name .

0
source

Source: https://habr.com/ru/post/1381238/


All Articles