带有登录凭据的 Bitbucket repo 克隆

Jon*_* xx 5 git bitbucket git-clone

我有一个到 bitbucket 的基本 git clone 命令,我必须在其中添加登录凭据,是否可以将登录凭据添加到 bitbucket git clone 命令?

https://myacc@bitbucket.org/myacc/app.git
Run Code Online (Sandbox Code Playgroud)

像这样的东西?

https://myacc@bitbucket.org/myacc/app.git -Password "123"
Run Code Online (Sandbox Code Playgroud)

Col*_*dIV 12

你可以,与:

git clone https://user:password@bitbucket.org/myacc/app.git
Run Code Online (Sandbox Code Playgroud)

但这会将您的凭据保存在.git/config.
为避免之后您可以更改原点
git remote set-url origin https://myacc@bitbucket.org/myacc/app.git

  • @MarinosAn 您可以为 @ 输入 %40。更多信息:https://fabianlee.org/2016/09/07/git-calling-git-clone-using-password-with-special-character/ (3认同)