gpt4 book ai didi

javascript - 使用 gulp-git 克隆一个带有凭据的 git repo

转载 作者:行者123 更新时间:2023-11-29 21:31:25 25 4
gpt4 key购买 nike

我正在尝试通过 gulp-git 从个人服务器克隆一个 git 存储库到“测试”文件夹中,它需要用户名和密码。不确定如何传递用户名和密码。请注意它不是 github 存储库

gulp.task('clone', function(){
git.clone('http://webrepo/git/mytest.git',{args:'./test'},function(err){
if (err) throw err
});
});

最佳答案

您应该能够在您的 repo URL 中指定用户名和密码:

gulp.task('clone', function(){
git.clone('http://username:password@webrepo/git/mytest.git',
{args:'./test'}, function(err) {
if (err) throw err;
});
});

当然,所有关于在文件中存储明文密码并通过普通 HTTP 传输密码的常见注意事项均适用。

关于javascript - 使用 gulp-git 克隆一个带有凭据的 git repo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36315112/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com