84

After initialising a new local repo there is a description file present.

What is it used for and how should I format it? Or is it simply a local helper file.

This thread Accessing git's `description' file suggests one style, but no man page or other reference to why it should be the way it is.

0

4 Answers 4

61

description file is only used by the GitWeb program ( to display the description of the repo on the GitWeb page)

https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain

Otherwise, how you use it is left to you and I don't see a point in a "style" for it.

3
  • It seems to be in section 5.5 onwards in the current pdf, but it's all useful. Jul 29, 2011 at 18:11
  • Hence, it should be told: that file is indeed generally not filled in for a local clone. You typically use it in a bare repository for the blessed repository where the Git Web GUI is reading repositories informations from (say indeed GitWeb, and the likes). Jun 2, 2015 at 20:19
  • 2
    GitBlit also seems to use it. Jul 6, 2016 at 2:05
53

The description file can also be read by hook scripts or other scripts pertaining to the repository. For example, one popular hook script, post-receive-email, sends an email to all members when a commit is made to the repository, and uses the contents of the description file as the name of the repository in the email subject.

2
  • 1
    For completness, only the first line is used by the hook. Oh yes, and I have not found if the rest of the file is actually displayed anywhere... :-|
    – Martian
    Nov 16, 2012 at 7:40
  • 2
    Another tool which uses this file is git2html, which is useful on static sites. I think that falls under your "scripts pertaining to the repository" umbrella :)
    – Warbo
    Sep 30, 2015 at 11:42
6

description is just a text file that is shown as project description in web frontend.

Just write there something that explains what the repository is about.

2

The content of this file is also used by gitolite with the "desc -ld" command.

you can modify this file, but it doesn't seem to me that it's taken into account to be commited.

1
  • To set or modify the description on a gitolite server, use ssh: ssh git@host desc <repo> <description string> Dec 19, 2017 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.