Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push .git/description file

Tags:

Is it possible to push the changes in the .git directory to a remote repository?

I wish to have a common project description and not have to re-enter it for all the clones of my repository.

It's strange that the project description is something that is not common to each clone.

like image 370
Verhogen Avatar asked Jul 09 '10 16:07

Verhogen


People also ask

What is description file in git?

Git generates a file named description which contains the name of the repository as set by the user. It is located at . git/description. It has a default value as an unnamed repository and the developers should place the actual project name and description in this file.

How do I change my git description?

On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter. In your text editor, edit the commit message, and save the commit.


1 Answers

You could store a description (or .description, if you don't want it to be visible) in the root of your repo, and then symlink .git/description to that in each repo, like so:

repo/   .description   .git/     description -> ../.description 

You'd have to set up the symlink manually in each of your repos, but you'd only have to do that once (when the repo is created).

Or you could use a post-receive hook to copy your tracked description file into .git/description. You'd have to set up that hook on each remote repo, too, but again, that would only need to happen once (when the repo is created).

like image 175
mipadi Avatar answered Sep 21 '22 06:09

mipadi