git push .git/description file

前提是你 提交于 2019-12-03 05:42:05

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/3214871/git-push-git-description-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!