Skip to content

Instantly share code, notes, and snippets.

@volkbay
Last active April 22, 2024 13:49
Show Gist options
  • Save volkbay/e0d4d8b277fea95e37734336d970c4ac to your computer and use it in GitHub Desktop.
Save volkbay/e0d4d8b277fea95e37734336d970c4ac to your computer and use it in GitHub Desktop.
Disable Git security check on Termux

👾 Error

fatal: detected dubious ownership in repository at '/storage/emulated/0/<some_folder>'
To add an exception for this directory, call:

        git config --global --add safe.directory /storage/emulated/0/<some_folder>

🤔 Why do I see this error ?

This is a simple check (by Git) comparing current user ID and the ID of the owner of the current folder. If they do not match (in case of rootless Termux, root owns them all.), Git will not permit any action (even git status).

🔎 How to solve it ?

Warning Please do not use this workaround on shared devices. Your work may end up with malicious software.

It will suppress Git security check by trusting all the directories. You can check the status of your safe directories by git config --global --list

🕊️ Solution In your terminal:

git config --global --add safe.directory '*'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment