git无密码push

近来项目中调研,jupyterlab和git的整合内容,git server我使用的gitbucket和bitbucket.(项目要求使用bitbucket,看错一个字母下载了两个镜像)

gitbucket是免费的,bitbucket需要收费,使用容器的话也需要先用gogole邮箱注册一个账号,生成试用的license,可以用一个月。

我使用jupyterlab-git插件来访问git server,但是此插件没有提供用户安全验证,所以我clone下来之后,无法push,pull.

经查找资料,找到如下方法,记录一下:

1.git clone xxx.git

git config --global user.name "xxxx"
git config --global user.email "[email protected]"
2.进入项目目录,生成文件.git-credentials

touch .git-credentials

cat .git-credentials
https://zdwhl:[email protected]:7990

最后执行下面的命令
git config --global credential.helper store
这样https的方式就可以无密码git pull,git push了。

猜你喜欢

转载自www.cnblogs.com/huaxiaoyao/p/10848233.html