-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Make git usage on /storage/emulated/0 possible. #3777
Comments
The whole issue with git is limitation of file system mounted at This is not about bugs or feature lack in Git or Termux. We are not going to re-implement Git to match FS behavior either. The Git provided in Termux is compiled from sources available at https://mirrors.kernel.org/pub/software/scm/git. That's a mirror of the official Git implementation: https://git-scm.com/download/linux. Termux app itself doesn't have effect on how software is being executed inside. It is just a display.
Apps can access files in Termux home directory. You don't need root for that. This directory can be opened as storage volume like MicroSD or USB drive.
Moderators in /r/termux (Reddit) are Termux developers. No need to report same issue again and again. Users have to be aware about these two things:
|
Thank you so much for your reply, i don't think you realize how much it helped me Reimplementing git, or reimplementing filesystem features, sounds like a terrible idea honestly. I know WSL has some special jank way of emulating linux file system permissions in NTFS, but honestly, i think it caused more problems than it solved, and i think someting like that would only happen here if someone tried this out of their own genuine interest. Thank you so much for pointing me to other ways to fix my problem - if apps can access termux home, all my problems are solved. Anyway - i apologise for opening an issue here, maybe i should've found help somewhere else - |
|
Unfortunately, the app Obsidian, that i'm using, doesn't support access to the Termux home directory. But i found a solution and i'll share it for future reference: I moved the repository to termux storage, created a new branch: git branch empty
git checkout empty then deleted all files except the .git folder and made a commit then, i ran git worktree add ~/storage/shared/Documents/reponame master This will make sure git object files stay on the termux file system, while reading and writing happens on shared storage. If all is as expected, i should have way faster pulls and pushes, as well as a way smaller chance of corruption. |
@kartonrad just wanted to say thank you for this brilliant solution. have you been using it for a while and can confirm that it works? I've been trying to figure out a solution for my obsidian sync project for a while before finding your idea. |
@DovieW In use on two Android Devices, never faced repository corruption ever again One thing: But it happens so rarely that maybe i just imagined it xD Maybe i really did forget to delete that file after all |
@kartonrad Thanks for the response. Great to hear it's working. I think it's working for me too. I think I noticed that Git is running faster too? I'm not sure. Hopefully people don't switch branches often for Obsidian use. I definitely don't. I wonder what the use case would be. But I'll keep an eye out for that. I added a script to the issue that I linked that sets it up after you've cloned it to the dir you want the repos in. Maybe you can use it. Just change the variables at the top. |
Feature description
Currently, git usage on /storage/emulated/0 is not feasible, because of frequent corruption of object files.
The severity of the corruption varies randomly, but is always a big disruption in workflow
The only way to use git on shared storage right now is through tools like MGit, which cannot be automated and are annoying to use compared to succesful lucky-runs of termux git scripts.
This is all necessary if other apps (code editors, notes, gallery, etc.) are to access the repo's files.
Unfortunately, i'll have to be upfront about this, i don't know why this is the case, just that Moderators on r/termux (contributers?) seem to be aware of this limitation.
Maybe this is an inherent property of the storage interaction, however, i would love if there was some possibility to fix this, even for a substantial performance penalty - when using an alternative api for precision-access for example.
I have zero expertise on this field, so feel free to make a successor issue and close this one.
If you have an idea how to implement this but don't see it as a priority, feel free to point me to some starting points -
i can't promise anything myself but one day i might be willing to dig in and aquire the neccesary skills to work on it
Thank you for this amazing app!
Additional information
https://www.reddit.com/r/termux/comments/131y4rh/git_object_corrupt/
https://github.com/termux/termux-packages/issues
The text was updated successfully, but these errors were encountered: