社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

git-使用用户和密码将参数传递给git

Eduardo Lucio • 7 年前 • 1792 次点击  

我需要使用用户和密码向Git传递参数,如下面的示例所示。

注一: WA不能使用 git config --global credential.helper 'cache --timeout=1800' 例如。
注二: 分支机构 [BRANCH_NAME] 必须设置为跟踪远程分支 [分行名称] 从 origin .

#!/bin/bash

USR_CREDENTIALS="https://[USER_NAME]:[PASSWORD]@[GIT_URL]/PROJECT.git"
BRANCH_NAME="[BRANCH_NAME]"
git fetch $USR_CREDENTIALS --all --prune

# ERROR: fatal: fetch --all does not take a repository argument

git checkout -b $BRANCH_NAME origin/$BRANCH_NAME

# ERROR: fatal: 'origin/[BRANCH_NAME]' is not a commit and a branch '[BRANCH_NAME]' cannot be created from it

我在上面的代码中犯了什么错误?有什么解决办法吗?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/37025
文章 [ 1 ]  |  最新文章 7 年前