Yes. There are at least two major ways of doing that. First, you don't have to use "the" staging area, you can have as many staging areas as you like -- set GIT_INDEX_FILE=/path/to/private/index
and do as you please; second you can construct commits yourself, directly. It isn't even hard.
Git's repository core deals with blob, tree, and commit objects (also, not so relevant here, notes and annotated tags). The git command to dump objects is git cat-file -p
.
A blob is just a bag-o-bits. Add one to the repository with git hash-object -w
filename
, it'll print the ~true name~ of the blob in that file and add the blob to the repo. A tree ties an object to a filesystem name. Add one to the repository with git mktree
; to see what to feed it, print a tree with e.g. git cat-file -p HEAD^{tree}
. Add a commit to the repository with git commit-tree
, basically, you say git commit-tree -p
mom
-p
dad sometree
, set some environment variables, and feed it a commit message on stdin.
That's really all that's necessary; if you want to get further into slicing and dicing with trees and staging read-tree
and write-tree
can be very useful, if this is at all attractive to you the git core tutorial is a good overview.
commit
as well. – Crosswaydid not match any file(s) known to git
– Messner