using gitlab token to clone without authentication

前端 未结 14 2690
失恋的感觉
失恋的感觉 2020-11-28 17:56

I want to clone gitlab repository without prompt for my automation script, by using my private token from my gitlab account.

Can someone provide me a sample?

<
14条回答
  •  隐瞒了意图╮
    2020-11-28 18:25

    Use the token instead of the password (the token needs to have "api" scope for clone to be allowed):

    git clone https://username:token@gitlab.com/user/repo.git
    

    Tested against 11.0.0-ee.

提交回复
热议问题