Git was not designed for single-file projects, or managing multiple text files independently within a directory.
However, below shell script and accompanying Vim commands work around it by creating a unique bare repository for each file (using a Git command to set a different location for each file's .git
directory).
Copy the following script into a folder in $PATH
, say as ~/bin/git1
(or g1
) and mark it executable:
#!/usr/bin/env bash