首页 > 其他分享 >使用token添加仓库授权

使用token添加仓库授权

时间:2023-01-29 17:31:45浏览次数:124  
标签:origin git remote 仓库 github url token 添加 https

设置url 命令

git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git

<your_token>:换成你自己得到的token <USERNAME>:是你自己github的用户名 <REPO>:是你的仓库名称

示例:

1.添加remote仓库

git remote add origin ​​https://github.com/zhangyujiayou/datastruct.git​

2.添加仓库的授权

git remote set-url origin ​​​​​​​​​​​​https://[email protected]/zhangyujiayou/datastruct.git​​

3.即可以使用命令推送

git push -u origin master







标签:origin,git,remote,仓库,github,url,token,添加,https
From: https://blog.51cto.com/Auqin/6025890

相关文章