gitlab - Push to a repository using access_token

后端 未结 3 727
温柔的废话
温柔的废话 2020-12-25 11:12

I implemented the oauth2 web flow in order to get access_token from users of my app. With the access_token, I would like to do the following actions:

  1. Get use
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-25 11:44

    You should do

    git remote add origin https://:@gitlab.com/myuser/myrepo.git
    

    Note that this stores the access token as plain text in the .git\config file. To avoid this you can use the git credential system, providing the access token name for "username" and the access token for "password". This should store the credentials in the git credential system in a more secure way.

提交回复
热议问题