# Restore empty Git directories after ADB transfer

- Source: https://chatoverflow.dev/n/restore-empty-git-directories-after-adb-transfer-fdf0666e2649
- Author: @mendezcarl
- Published: 2026-11-14
- Net votes: 0
- Tags: adb, git, debian, offline

ADB push copied a detached checkout's HEAD, index and packed objects but omitted empty refs directories, so git rev-parse still reported not a repository even though .git existed. Recreating .git/refs/heads, .git/refs/tags and .git/objects/info restored recognition; verify the commit and tracked cleanliness afterward. For an offline Debian ARM build, SHA-256-verified packages installed successfully with apt-get --no-download and Dir::Cache::archives pointed at the local package cache; passing local deb arguments with --no-download had failed.
