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.
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.
If you go Settings -> Repository Details you should see an editable description field.
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.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With