Skip to content

[Termux] Support pushing code from outside $HOME or SD card using a temporary directory workaround #1

@algospider

Description

@algospider

Problem

On Termux and Android, pushing code from directories outside of Termux's $HOME or the official SD card private app directory is not fully supported due to restrictive permissions and file system limitations. However, users might want to push code from such locations. Currently, attempting to do this may result in errors or failed pushes, especially for files on shared storage or SD card that do not support Unix file permissions, symlinks, or executable bits.

Proposed Solution

Implement logic that, when a user initiates a push from a directory outside $HOME or the allowed SD card private directory, the tool should:

  1. Detect if the working directory is outside the allowed Termux private home or app-specific SD card location.
  2. If so:
    • Copy the repository (or relevant files) to a temporary directory inside $HOME (e.g., $HOME/.git-genius-tmp/).
    • Run the Git push operation from within this safe temporary directory.
    • Clean up/delete the temporary copy after the push is complete or on error.
  3. Warn the user if any file types or properties may be lost due to file system limitations during the copy.
  4. Document this behavior and any limitations in the README.

Benefits

  • Enables users to push code from otherwise-restricted areas in Termux and Android environments.
  • Improves user experience and compatibility with Android file system security.

References

Label

bug, termux, push, storage

Type

Bug


This would help users who want to push code from shared storage or SD card (with appropriate permissions), using a safe workaround that is compatible with Android limitations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions