In almost all of my projects I have few files that are "project wide" in the sense that their contents should be shared across all branches. These files usually include project schedules, to-do lists, wikis, and the like. Currently I have them included .gitignore
so that they are not versioned but remain the same no matter what branch I have checked out. However I'd really love to have them versioned in a way that is "orthogonal" to the versioning of the source code. Is this possible with git
without too much pain?
You could have those files (wiki, todo and so forth) in their dedicated Git repository, and then add them to a development repository through the subtree merge strategy (as described in this question).
That way, they get included in any development, and they also get updated by those sub-projects.
Any modification in a branch doen by a sub-project can then be merged back in a "main" branch in the original "wiki" Git repository, and all sub-projects can merge their own development branch with that main "wiki" branch in order to update this content included through a subtree merge.
Not exactly an "orthogonal" versionning, but still a practical solution.
I usually prefer to use a separate tool for scheduling, issue tracking, wiki docs etc. For example, Trac provides such features and integrates nicely with a git backend. Source control is used only for, well, source control.
If you want to use a source control tool for storing project management data, consider having separate projects in the source control for "management" and "implementation".
Can't you just have one universal/project wide branch, then a bunch of project branches?
You could use git submodule
to insert a reference to the project wide repo onto all your repositories.
来源:https://stackoverflow.com/questions/908087/how-to-version-project-schedules-to-dos-wikis-etc-in-git