English 中文(简体)
git init和模板未找到
原标题:git init & templates not being found
  • 时间:2023-12-13 23:05:47
  •  标签:
  • git

我不想使用 g模板,因此,我可以就我在当地拥有的所有回馈拥有几个预先确定的hoo。 然而,当我试图在/code>中操作git时,它没有在名录中找到模板。 如果我通过其他手段具体指出这一点,情况就是如此。

[nix-shell:~/tmp/ai-webui/foo]$ git config --global init.templateDir
 /home/abrahms/.git_template/ 

[nix-shell:~/tmp/ai-webui/foo]$ git init
warning: templates not found in  /home/abrahms/.git_template/ 
Initialized empty Git repository in /home/abrahms/tmp/ai-webui/foo/.git/

[nix-shell:~/tmp/ai-webui/foo]$ git init --template=/home/abrahms/.git_template/
Reinitialized existing Git repository in /home/abrahms/tmp/ai-webui/foo/.git/

[nix-shell:~/tmp/ai-webui/foo]$ export GIT_TEMPLATE_DIR="$HOME/.git_template/"

[nix-shell:~/tmp/ai-webui/foo]$ git init
Reinitialized existing Git repository in /home/abrahms/tmp/ai-webui/foo/.git/

[nix-shell:~/tmp/ai-webui/foo]$ unset GIT_TEMPLATE_DIR

[nix-shell:~/tmp/ai-webui/foo]$ git init
warning: templates not found in  /home/abrahms/.git_template/ 
Reinitialized existing Git repository in /home/abrahms/tmp/ai-webui/foo/.git/

[nix-shell:~/tmp/ai-webui/foo]$ git --version
git version 2.40.1

d 期望<条码>git init就象注明国旗或<条码>-template。

问题回答

它请你引述<代码>init.templateDir的价值。 你们不要在产出中看到这些缩略语。 例如,如果我跑的话:

git config --global init.templateDir ~/.config/git/templates

接着是:

git config --global init.templateDir

产出如下:

/home/lars/.config/git/templates

不是(你在问世时表示):

 /home/lars/.config/git/templates 

在我的全球聚会上,我看到:

[init]
    templateDir = /home/lars/.config/git/templates




相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签