git push .git / description文件 [英] git push .git/description file
问题描述
是否可以将 .git
目录中的更改推送到远程存储库?
我希望有一个共同的项目 description
,而不必为我的存储库的所有克隆重新输入它。
奇怪的是,项目描述是每个克隆都不常见的东西。
您可以存储描述
(或 .description
,如果您不希望它可见),然后符号链接 .git / description
,就像这样:
repo /
.description
.git /
描述 - > ../.description
您必须在每个repos中手动设置符号链接,但是你只需要这样做一次(当创建回购时)。
或者你可以使用post-receive hook 将跟踪的描述文件复制到 .git / description
中。你也必须在每个远程仓库上设置钩子,但同样,这只需要发生一次(创建仓库时)。
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.
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).
这篇关于git push .git / description文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!