0

I have a folder F containing a .git folder on my machine A. I connect my phone to the machine A, and copy the folder F on my machine. The copy seems going well: I have on my phone memory the folder F with its content.

But when I try to access to the folder F after unplugging my phone, the folder F is empty, the .git folder is not present anymore, and whatever the machine on which I try to access my phone memory, the folder F is empty.

Is there a way to copy a .git folder via my phone memory?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
user2443476
  • 1,935
  • 9
  • 37
  • 66
  • 1
    How do you look at the folder F after you've copied it to your phone? – mkrieger1 Feb 05 '17 at 22:44
  • Is it possible that you are not seeing the .git folder because it starts with a dot and is hidden by default in the file browser you are using? – mkrieger1 Feb 05 '17 at 22:47

1 Answers1

0

whatever the machine on which I try to access my phone memory, the folder F is empty.

Try and access <usb_drive_letter>:F\.git after copying.
Validate that the repo is there with:

cd <usb_drive_letter>:F\.git`
git log

But another way to backup a repo on an usb key is with git bundle: that generates only one file which represents your repo.
See "How to backup a local Git repository?".

cd /path/to/your/local/repo/F
git bundle create <usb_drive_letter>:\F.bundle --all
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250