Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the description of a Git repository

Tags:

git

I'm trying to find a way to store and retrieve the description of a bare Git repository.

For normal repositories, I use a README file where I can leave a description of the project. But this does not exist in a bare repository.

I'm using the description file in the bare repository at the moment. But I wanted to know if there was a git command to read and/or set the contents of this file without having to open/edit the file directly.

like image 774
Abizern Avatar asked Jul 14 '11 14:07

Abizern


People also ask

How do I find my git repository details?

The default name (also known as an alias) for that remote repo is origin. If you've copied a project from Github, it already has an origin. You can view that origin with the command git remote -v, which will list the URL of the remote repo.

Where is the description in GitHub?

If you go Settings -> Repository Details you should see an editable description field.

What is GitHub repository description?

A repository contains all of your project's files and each file's revision history. You can discuss and manage your project's work within the repository.

How do you describe a repository?

In information technology, a repository (pronounced ree-PAHZ-ih-tor-i) is a central place in which an aggregation of data is kept and maintained in an organized way, usually in computer storage.


2 Answers

No, description file is self-contained, so there's no need to provide git commands to edit/view it. Just use it as a normal file.

like image 83
CharlesB Avatar answered Nov 15 '22 03:11

CharlesB


Note: as an alternative, you can consider git notes: a note can be put, updated or removed even in a bare repo!

VonC@NETVONC /c/Prog/git/t/gitolite.git (BARE:pu)
$ git notes --ref descr add -m "a description" initcommit

VonC@NETVONC /c/Prog/git/t/gitolite.git (BARE:pu)
$ git notes --ref descr show initcommit
a description

What I like to do is to tag the first commit with a tag nammed "initcommit", that way I can easily get back a note in a given namespace (here 'descr'), if that note isn't supposed to have information about a "current" commit, but rather information valid for the all repo.
So I attach said note to a "fixed" commit I know I can always refer to (here the first commit, with its dedicated tag).

like image 22
VonC Avatar answered Nov 15 '22 04:11

VonC