问题
I have used this command to archive a git source code:
git archive --format=tgz -o ~/myproj-20180402.tgz --prefix=myproj/ master
Are there same/similar way to archive a AOSP repo branch or tag. How to do ? Any help would be greatly appreciated.
回答1:
AOSP code is not a single git project, it's actually many more (hundreds). So there is not a git command per-se.
What you could do is use repo this way:
repo forall -j16 "<your-git-command-1; your-git-command-2>"
So for the exact git command you proposed it would be:
repo forall -j16 "git archive --format=tgz -o ~/myproj-20180402.tgz --prefix=myproj/ master"
But keep in mind there is not a single git project, so you will end up with hundreds of archives, each inside it's root dir. Check the manifest you sync for a full list of projects and it's location locally.
来源:https://stackoverflow.com/questions/49603844/how-do-i-archive-an-aosp-repo-like-git-archive-doing