How to clone entire AOSP codebase locally

994 Views Asked by At

I have AOSP code base in my system and i want take the backup of entire codebase to my external drive and I dont want to do repo sync or anything. I tried copying the folders manually but when I tried to do git log in my destination folder it shows as fatal and I feel that the git has been corrupted during manual copy. So is there any way we could do this by git clone for all the repositories or is there any other way?

2

There are 2 best solutions below

2
VonC On

It is better to:

  • use git bundle in order to generate one file (representing the full repository with its history)
  • copy that one file over the external drive
  • clone from that one file somewhere else (the bundle file acts as a remote repository, from which you can clone/pull)
0
Farhan Ar Rafi On

Why don't you try to copy just the .repo folder into the external drive and whenever you need to build another system, just copy it back into another folder and run repo sync there?

If you are worried about your changes, then you should commit your changes, make a patch file, and keep a backup for that also. Using the patch file, you will be able to restore your changes on the new repo.