将配置参数保存到存储库 [英] Save configuration parameters to the repository

查看:152
本文介绍了将配置参数保存到存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用git-ftp,它允许我将我的提交推送到FTP服务器。

I've just started using git-ftp, which allows me to push my commit to an FTP server.

FTP凭证存储在.git / config以这种方式:

The FTP credentials are stored in .git/config in this way:

[git-ftp]
    user = myusername
    url = ftp.myserver.com/httpdocs/
    password = mypass

我想要的是,任何克隆我的git仓库中的项目也自动获得了上面的配置。

What I would like, is that anyone who clones the project from my git repository, automatically gets the configuration above as well.

但是,我怎样才能'将'这个git配置'推送'到我的仓库?

But how can I 'push' this git configuration to my repo?

详细了解git-ftp: https://github.com/resmo / git-ftp

Read more about git-ftp: https://github.com/resmo/git-ftp

推荐答案

这是不可能的,正如这个答案。 Git配置文件始终是存储库本地的,不能被推送或提取。最好的解决办法是把一个包含git-ftp参数的文件(除了密码),并在README中显示说明。

This is not possible as explained in this SO answer. Git config file is always local to a repository, and can't be pushed or fetched. Best solution is to put a file containing the git-ftp parameters (excepted the password), and display instructions in a README.

这篇关于将配置参数保存到存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆