1

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
    A normal recursive copy (`cp -R` or `cp -a`) from the command line should be sufficient. Some people have reported problems copying using drag-and-drop in Windows, so you really should use the command line for this. – bk2204 Jan 25 '20 at 04:03

2 Answers2

0

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)
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • 1
    Git bundle cannot be done from the root of the code base since it does not contain .git and it will show "fatal: Need a repository to create a bundle" and AOSP code base is a collection of large number of repositories, so its a tedious job to go inside each repository and do 'git bundle'. But the root of code base contains .repo folder, so is there any way to do with repo tool? or repo in combination with git? – Abhishek jr Jan 27 '20 at 03:45
  • @Abhishekjr not sure: all I see is https://blog.donghwi.kim/3745/ (update_bundle.sh) – VonC Jan 27 '20 at 05:22
0

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.