views:

208

answers:

2

I known that with subversion you can attach arbitrary properties to each files.

In Subversion some properties have special meaning, they are the properties in the "svn:" namespace, but you can attach any arbitrary property to files.

I wonder if git or any other distributed version control system support this feature.

Any other version control system (distributed or centralized) has the support to something similar to the subversion properties?

+1  A: 

The closest thing would be gitattributes

 $GIT_DIR/info/attributes, .gitattributes

A gitattributes file is a simple text file that gives attributes to pathnames.
Each line in gitattributes file is of form:

pattern attr1 attr2 ...

That is, a pattern followed by an attributes list, separated by whitespaces.
When the pattern matches the path in question, the attributes listed on the line are given to the path

VonC
A: 

It is possible to add any attributes you want to the git attributes files. You can then query the values with git-check-att (http://www.kernel.org/pub/software/scm/git/docs/git-check-attr.html). As far as I know there is no corresponding git-set-attr type of function, you'd have to uptdate the git attributes files directly.

Use .gitattributes for attributes that will version controlled and move when the repo gets cloned , pulled etc

use $GIT_DIR/info/attributes for 'private' attributes that will not be moved when the version history get transferred to another repo

Alec the Geek