Is it possible to commit a file in a git branch with out checking out that branch? If so how?
Essentially I want to be able to save a file in my github pages branch
I made a little tool that does exactly this: https://github.com/qwertzguy/git-quick
It let's you edit specific files from another branch without checking out the other branch completely (just the files you want to edit) and commit them. All this without ever affecting your working copy or staging area.
Behind the scenes it uses a combination of git worktree and sparse checkout. The source is fairly small, so you can read through.