I'm trying to create a basic GIT web UI for GIT bare repos which allows edit (only) of existing files.
For example, considering these two cases:
- /dir-a/dir-b/dir-c/a-file.txt
- /a-file.txt
How could I use the Git low level plumbing commands to save the edits? Also, I'm using Grit, not sure if it provides a shortcut to do this.
I do not know about Grit, but with Git itself you could do it like this, using the index.
Let's assume that the new content to be stored in dir-a/dir-b/dir-c/a-file.txt is available in /tmp/new-content.txt.