Username and password in command for git push

前端 未结 6 364
不思量自难忘°
不思量自难忘° 2020-12-04 07:55

It\'s possible to clone down a git repository, specifying username and password in the command. Example:

git clone https://username:password@myrepository.biz/f

6条回答
  •  -上瘾入骨i
    2020-12-04 08:42

    According to the Git documentation, the last argument of the git push command can be the repository that you want to push to:

        git push [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=]
                 [--repo=] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream]
                 [ […]]
    

    And the repository parameter can be either a URL or a remote name.

    So you can specify username and password the same way as you do in your example of clone command.

提交回复
热议问题