nogit: Using git to track files without the user using git Summary ======= Let's see, nogit is a very simple tool that uses git under the hood to allow for collaboration on files, but without requiring the the collaborators to invoke git commands. Any time a user might invoke "git commit", or "git push", or "git pull", etc. the user instead just invokes "nogit sync". And the user will not be prompted to fill out a commit message or to resolve conflicts, etc. Installation ============ The nogit implementation is a simple bash script named "nogit". To install it, simply copy it to a directory on your PATH. Or, if you'd like to be able to follow along with nogit changes from a git repository, you might create a symlink from a directory on your PATH to the nogit script in the git repostiory. Usage ===== Presumably, you've been pointed to a repository which is intended to be used with nogit. These repositories are often paired with a "parent" repository that is being tracked with git. If so, the procedure for cloning should look something like this: git clone /url/of/parent cd parent nogit clone /url/of/nogit/child And after that, you can run "nogit sync" whenever convenient, (when you've made changes or you think there might be upstream changes to the files being tracked in the nogit repository). Note that "nogit sync" should not ever ask for user input, so it's appropriate to call "nogit sync" from an autoamted system, (such as a text editor's hook when saving a file). If you're interested in setting up a parent and child repository for use with nogit, here's what you'll want to do: In the parent repository ------------------------ Add the following to .gitignore: .nogit .gitattributes Any files to be tracked in the child nogit repository For the child repository ------------------------ Create a new git repository Add the files to be tracked via nogit Add a .gitattributes file with contents such as: * merge=union The * is a pattern to match the files you're tracking. You don't necessarily need to use '*' you can explicitly name the files of interest. But the important thing is that all files tracked by nogit use the "union" merge driver (so that merges don't result in conflicts requiring user intervention). Motivation ========== I originally came up with nogit when I started maintaining a simple TODO file for a project which had a code implementation split across multiple code repositories. I was intentionally keeping my TODO file outside of revision control to be lightweight in a couple of ways: 1. Many TODO items required implementing a feature in multiple repositories (both client and server, say), so having a separate TODO file meant I didn't need to decide which repository to add the TODO file to. And I also didn't need to add the same entriy to TODO files in each of multiple repositories. 2. TODO items are self-descriptive. Any commit message I might have written when adding a TODO item would be adequate as "Add " and similarly for "Remove " so there's inherently no advantage to commit messages for these changes. Of course, a significant disadvantage of my approach was that my TODO file was totally private. I was missing out on the collaborative features that git provides. So, nogit was conceived of as a way to keep my lightweight process of maintaining the TODO file, (simply editing the file and doing nothing more), while also allowing for distributed editing of the file.