Is it possible to have a folder inside .git that changes with branch?

I want to implement branch specific functionality to help me with my git work flow. To do that, I need to save some metadata (not necessarily in one file) regarding the branch, and I'd like to keep it hidden from the actual files under version control, but still "on site" - it should follow me if I decide to relocate my repositories folders. .git seems to be a fitting place for that, but I haven't found a way to have a folder inside it that will change with the branch.

Is such a thing possible? How?

Answers


The .git folder is the only thing in the working directory that is never tracked by the Git repository. If you want to have that meta stuff included in the repository and keep it for example when you clone or push, then you will have to keep it in the working directory and add it in the usual way.

Otherwise if you are fine with it being just there for your one local repository, then sure, put it in the .git folder. You will not be able to version your metadata then though or change it when the branch changes; you will need to have a different mechanism for that.

Otherwise I would argue that if the data is relevant to your source, you should keep it in the working directory and have it versioned by Git. Or if it’s not that relevant, it shouldn’t be there at all.


Need Your Help

make ajax constantly send data to php script and retrieve results?

php javascript jquery html ajax

how can you be constantly sending data through an ajax request (POST) to a script, and constantly retrieving the results? Id prefer a jquery method but plain ajax is fine too.

C# Format list items with BAR between words

c# list loops

My code is currently busted and I am aware of this. I'm working one one part at a time and I have hit two stumbling blocks which I'm hoping to find help here in regards too.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.