This is a recreation of a stackexchange question, in case the community here is more knowledgeable.
Link to stackexchange question : http://unix.stackexchange.com/questions/325753/git-annex-link-to-different-file-names
Content : "Maybe this is just a crazy use case that doesn't work, but I was wondering if there's a way to build a file's history from files with different file names. I'm exploring this idea because I'd like to have a git-annex system but I can't force my coworkers to adapt.
Here's what I have in mind :
Folder 1, managed by coworkers (On a shared disk) :
drawing_shop_12_nov_2015.pdf
drawing_shop_13_nov_2015.pdf
drawing_asbuilt_14_nov_2015.pdf
drawing_asbuilt_rev1_15_nov_2015.pdf
And
Git-annex, managed by me :
drawing.pdf
(with a shop branch and a asbuilt branch)
The git-annex's drawing.pdf would have an history like this :
[shop]
|
Commit A "Initial shop drawing"
|
Commit B "Add corrections from Wizzbasket"
\
|
[asbuilt]
Commit C "Reflect as built"
|
Commit D "Change dweezelbox block for simplicity"
But somehow the "managed by coworkers" repo would be a direct mode repo with Commit A pointing to drawing_shop_12_nov_2015.pdf, Commit B to drawing_shop_13_nov_2015.pdf etc.
Can this be done?"
Yes, you can do this. Effectively, you have two branches. In the master branch, you have drawing.pdf with a single name and changes commited to it. In the coworkers branch, you have the multiple different versions. Git has no difficulty representing this, but it's up to you to maintain the different branches.
For example:
In the example, I looked at what was committed to master, and copied and pasted the git-annex symlink into a new drawing_rev2.pdf file.
That's the basic idea. There might be a better way to do that. Another way, for example, would be to have 2 clones of the repo, one with master checked out and one with coworkers checked out. You could then run, in the coworkers checkout:
That results in the same commit as the method I showed.
With some scripting, you should be able to automate keeping the two branches in sync.