关于GitHub的使用命令

在GitHub使用过程中,避免不了用到Git命令,现记录一些日常使用的命令以便后期使用;


#配置 Git 的用户名、邮箱、秘钥、公钥

git config --global user.name "用户名"
git config --global user.email "邮箱"
ssh-keygen -t rsa -C "邮箱"
cat ~/.ssh/id_rsa.pub

 


#验证配置是否正常连接GitHub

ssh -T git@github.com

 


#克隆仓库时指定标签

git clone --branch <tag_name> <仓库URL>

例如:

git clone --branch v2.1.0 https://github.com/user/repo.git

注意:--branch 参数同时支持分支和标签名称

#包含子模块一起Git到本地

git clone --recurse-submodules https://github.com/user/repo.git

#还有和--branch 参数同时使用

git clone --recurse-submodules --branch v2.1.0 https://github.com/user/repo.git
上一篇 宝塔面板docker部署开源密码库bitwarden
下一篇 Windows Dism操作命令记录
浪里个浪

浪里个浪管理员

这个人很懒,什么都没有留下。

本月创作热力图

最新评论
hhsj
hhsj
11月24日
谢谢分享
hhsj
hhsj
11月24日
试一试
pp8877
pp8877
10月21日
我来试试哦
asd
asd
8月31日
谢谢分享
对与对的争执
对与对的争执
7月13日
666