]> git.cworth.org Git - nogit/blob - README
Fix an accidental case of a ".nogit" literal
[nogit] / README
1 nogit: Using git to track files without the user using git
2
3 Summary
4 =======
5 Let's see, nogit is a very simple tool that uses git under the hood to
6 allow for collaboration on files, but without requiring the the
7 collaborators to invoke git commands. Any time a user might invoke
8 "git commit", or "git push", or "git pull", etc. the user instead just
9 invokes "nogit sync". And the user will not be prompted to fill out a
10 commit message or to resolve conflicts, etc.
11
12 Installation
13 ============
14 The nogit implementation is a simple bash script named "nogit". To
15 install it, simply copy it to a directory on your PATH. Or, if you'd
16 like to be able to follow along with nogit changes from a git
17 repository, you might create a symlink from a directory on your PATH
18 to the nogit script in the git repostiory.
19
20 Usage
21 =====
22 Presumably, you've been pointed to a repository which is intended to
23 be used with nogit. These repositories are often paired with a
24 "parent" repository that is being tracked with git. If so, the
25 procedure for cloning should look something like this:
26
27         git clone /url/of/parent
28         cd parent
29         nogit clone /url/of/nogit/child
30
31 And after that, you can run "nogit sync" whenever convenient, (when
32 you've made changes or you think there might be upstream changes to
33 the files being tracked in the nogit repository). Note that "nogit
34 sync" should not ever ask for user input, so it's appropriate to call
35 "nogit sync" from an autoamted system, (such as a text editor's hook
36 when saving a file).
37
38 If you're interested in setting up a parent and child repository for
39 use with nogit, here's what you'll want to do:
40
41     In the parent repository
42     ------------------------
43     Add the following to .gitignore:
44        .nogit
45        .gitattributes
46        Any files to be tracked in the child nogit repository
47
48     For the child repository
49     ------------------------
50     Create a new git repository
51     Add the files to be tracked via nogit
52     Add a .gitattributes file with contents such as:
53
54         * merge=union
55
56     The * is a pattern to match the files you're tracking. You don't
57     necessarily need to use '*' you can explicitly name the files of
58     interest. But the important thing is that all files tracked by
59     nogit use the "union" merge driver (so that merges don't result in
60     conflicts requiring user intervention).
61
62 Motivation
63 ==========
64
65 I originally came up with nogit when I started maintaining a simple
66 TODO file for a project which had a code implementation split across
67 multiple code repositories. I was intentionally keeping my TODO file
68 outside of revision control to be lightweight in a couple of ways:
69
70   1. Many TODO items required implementing a feature in multiple
71      repositories (both client and server, say), so having a separate
72      TODO file meant I didn't need to decide which repository to add
73      the TODO file to. And I also didn't need to add the same entriy
74      to TODO files in each of multiple repositories.
75
76   2. TODO items are self-descriptive. Any commit message I might have
77      written when adding a TODO item would be adequate as "Add <item>"
78      and similarly for "Remove <item>" so there's inherently no
79      advantage to commit messages for these changes.
80
81 Of course, a significant disadvantage of my approach was that my TODO
82 file was totally private. I was missing out on the collaborative
83 features that git provides.
84
85 So, nogit was conceived of as a way to keep my lightweight process of
86 maintaining the TODO file, (simply editing the file and doing nothing
87 more), while also allowing for distributed editing of the file.