0

i am planning to use GIT for source control. How can i like add additional attribute to every file? i.e. IP Address, HDD Folder location

Planning to have Git with configuration management, for source code deployment.

KS Kian Seng
  • 319
  • 1
  • 6
  • 14
  • 1
    What do you mean by additional attribute ? Is this meta data that you are talking about ? I don't see the point with Git ... – Frodon Jan 28 '14 at 10:44
  • 1
    There is something called `notes` in git (see https://www.kernel.org/pub/software/scm/git/docs/git-notes.html), but it's not commonly used. What is it that you're trying to achieve? – Magnus Reftel Jan 28 '14 at 10:46

1 Answers1

3

Git just manages files on your hard disk. If you want to add additional attributes to each file, you must find a way to represent those attributes as new files on your hard disk.

A common solution is to add a folder with config files for a build system.

So when you have made your changes, you check them out on the server in a safe place (i.e. not where you want the files finally to end up). Then you invoke the build system which takes the additional files, figures out which original files need to be copied where and does it.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • Hi Aaron, other than having a folder storing the config files, is there another way? is there an ID for every file in the GIT? i am thinking of linking the ID to a table in DB – KS Kian Seng Jan 29 '14 at 01:36
  • The ID of each file is the path relative to the root of the repository. Each version of the file then has a hash code which you can use to identify it uniquely. – Aaron Digulla Jan 29 '14 at 08:10