You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**git-sym** will choose unique filenames based on checksums. But `git-sym add` is strictly for convenience.
83
-
You are free to use your own filenames. Anything symlinked via `GIT_ROOT/.git_sym` will be update-able.
84
-
85
-
Next, you might want to make those files available to other.
86
-
You can then move those files out of GIT_SYM_CACHE_DIR and into Amazon S3, or an ftp site, or wherever.
87
-
Just add rules to your `git_sym.makefile`.
88
-
89
-
## Other useful commands
90
-
```
91
-
git-sym show -h
92
-
git-sym missing -h
93
-
git-sym -h
94
-
```
95
-
96
-
# Details
97
-
## Typical usage
98
-
You will store relative symlinks in your repo. They will point to a unique filename inside `ROOT/.git_sym/`, where ROOT is `../../` etc.
99
-
100
-
`git-sym update` will search your repo for symlinks (unless you specify them on the command-line). For each, it will execute `ROOT/git_sym.makefile` in your `GIT_SYM_CACHE_DIR` (`~/git_sym_cache` by default). The makefile targets will be the basenames of the symlinks.
101
-
102
-
If all those files are properly retrieved, then symlinks will be created with the same filenames inside `.git/git_sym`. `ROOT/.git_sym` will point at that. And all other symlinks will point *thru*`ROOT/.git_sym`. Thus, there are three (3) levels of indirection.
103
-
104
-
## Makefile
105
-
Someday, we will offer a plugin architecture. But for now, using a makefile is really very simple. Just create a rule for each unique filename. (You *are* using unique filenames, right?) You can run `wget`, `curl`, `ftp`, `rcp`, `rsync`, `aws-s3-get`, or whatever you want. The retrieval mechanism is decoupled from caching.
106
-
107
-
You should try to ensure that you have a rule for every current symlink. Old rules for symlinks no longer in your repo are fine; they are simply ignored.
108
-
109
-
To test your rules:
110
-
```
111
-
export GIT_SYM_CACHE_DIR=~/mytest
112
-
git-sym missing # should report something
113
-
git-sym update
114
-
git-sym missing
115
-
```
116
-
117
-
## Other notes
118
-
### Cache
119
-
**git-sym** sets the mode to read-only for the cached files. These files should never change. You might want to name them after their own checksums. `git-sym add` can help you with that.
120
-
### Submodules
121
-
If your module can be used as a *submodule*, we cannot point at `.git/git_sym/` directly because for submodules `.git/` is not inside the tree. (The relative symlinks are constant, so they need to work no matter where `.git/` sits.) That is why we have *three* levels of indirection, in case your were wondering. (This is also why **git-annex***fails* for submodules.)
122
-
123
-
This is also why we write `ROOT/.git_sym`; it might be a different directory than `.git`.
124
-
125
-
For submodule support, you will also need this:
126
-
```
127
-
git config --global alias.gsexec '!exec '
128
-
```
129
-
We use that to learn the actual location of the `.git/` directory. If it fails, we try current directory, and if `.git` is not a directory there, we attempt to find it in `../.git/modules/REPO`, where REPO is the root directory. (This can fail in many ways. The alias never fails.)
130
-
131
-
Again, we expect you to forget that, so we add that alias to your local repo for you. Believe us: It's a Good Thing.
132
-
133
-
### git-sym-test
134
-
This module provides a way to test **git-sym**. It is not required.
135
-
However, it is listed as a git-submodule here for conveniently
136
-
testing submodule support.
137
-
```
138
-
git submodule update --init
139
-
```
140
-
141
-
### .gitignore
142
-
Since the intermediate symlink is also in the repo, but points to a changing target, it needs to be listed in `.gitignore`. (That anticipates both accidental `git add` and `git clean`.) We expect you to forget that important rule, so **git-sym** will detect its absence and add it to `.git/info/exclude` instead. No worries.
143
-
144
-
### Complicated symlinks?
145
-
We require a flat directory structure within `.git/git_sym`. If you need more files than your filesystem
146
-
can handle, you're Doing It Wrong. Git will slow down anyway.
45
+
## Examples
46
+
These examples explain the basics:
147
47
148
-
However, we support symlinked *directories*, which can then be an entire tree in GIT_SYM_CACHE_DIR. That should
0 commit comments