Reputation: 1293
I obtained a source code archive that had all its contents - apparently a bunch of Git repositories - bundled into a single ".repo" folder. Now I'm familiar with a ".git" folder, of course, but I'd never seen a ".repo" folder before and I am not sure how to use it. Some digging revealed there's a separate program from Git called "repo", apparently a helper tool built on top of it used for bundling multiple Git repositories together. Currently, I have the ".repo" folder extracted into its own enclosing folder wherein it rests alone.
I downloaded the repo
tool, but I am not sure how exactly to use it. In particular, what I want to do is to be able to access or "check out" a copy of one of the source trees inside the folder so I can then work on it normally, i.e. edit code, compile it and the like, just like when you clone a Git repository from the Internet and/or check a branch out from a repository. Documentation doesn't seem too helpful - it mostly seems to cover creating a repo bundle, not what you should do if you are given one and want to use it.
Is that possible? And if not, how is one "supposed" to use a .repo
insofar as manipulating, compiling, etc. the code in it goes? Even worse, when trying to use some commands on the repo
tool in the enclosing directory I get that various files aren't found, e.g. one of the contained projects is "u-boot" (the one I want), and I want to get the most recent commit stored the bundle, so I guessed I should try repo checkout HEAD u-boot
$ repo checkout HEAD u-boot
error: in `checkout HEAD u-boot`: [Errno 2] No such file or directory: u'/home/xxxxx/Software/yyyyy/u-boot/.git/HEAD'
The .repo folder is located on /home/xxxxx/Software/yyyyy/
(adulterated for privacy), i.e. that folder contains the .repo
folder, and I am running repo
from within it. Yet that spec in the error suggests for some reason repo
is not even trying to go into the .repo
directory like how Git would naturally look in a .git
. Instead it's acting like the contents to be searched have somehow been extracted outside of it. Is that correct? How then do I get them out?
Obviously I am completely clueless how to use repo
as I've never used it before and worse, the documentation does not tell you how to handle the use case where a .repo
folder is given to you.
Upvotes: 2
Views: 810
Reputation: 1328122
The repo
manifest (default.xml
) should include element remote
One or more remote elements may be specified.
Each remote element specifies a Git URL shared by one or more projects and (optionally) the Gerrit review server those projects upload changes through.
That means you can read the relevant Git URL for the project you want to work one, clone it and work on it using standard Git command, assuming you can push back to it (or you would need to fork it first).
Check if your .repo
content includes a default.xml
or a reference to the bare repository URL which includes said manifest.
Upvotes: 1