I’m new to git and don’t have a programming background – apologies for my ignorance.
Some background: I’m using git to sync a folder from my PC and iPad. To do this i made a GitHub repository which syncs to the folder on my PC via an application plugin (obsidian git). As this plugin isn’t recommended for iPad, I took a more manual approach and cloned the repo to a local folder on my iPad and added the GitHub repo as a remote repo. I use A-shell on the iPad to run git commands via libgit2 (lg2) which came preinstalled in A-shell.
This workflow was working fine until a merge conflict emerged on my iPad, preventing me from pulling from or pushing to the remote repo (I think all of the commits i tried to make on my iPad during this period failed). I solved this merge conflict with a .gitignore file that excludes the file that created the conflict (which I don’t want to sync across devices anyway). Once the conflict was resolved I pulled from the remote repo before committing my local repo which deleted a few local files, some of which I don’t remember their name. I’m worried that these files are now unrecoverable because the commit attempts made from my iPad when the conflict existed don’t appear in the log history.
I tried inspecting the contents of the commits in my log to see if any of them contain references to these files. To do this I used ‘lg2 log’ to view the commit history and get the commit hashes and then ‘lg2 show ’ but this command fails with the error:
“Command not found: show”
Why would libgit2 not include the command ‘show’? Is there a beginner friendly way to add this command?
If none of the previous commits contain a reference to these deleted files is there any way I can recover them?
I imagine there are many ways in which I messed up here, can anyone offer pointers on how to avoid making mistakes like this in the future?
Thank you!
Jacob Solomon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.