Linux&CentOS7>使用git

安装并配置Git

1.Linux下安装配置git

yum install git #使用yum安装git
git config --global user.name "Your Name" #配置用户名
git config --global user.email "[email protected]" #配置邮箱
git config --list #查看配置是否生效
ssh-keygen -t rsa -C "[email protected]" #生成ssh key 按三下回车就可以了
cat ~/.ssh/id_rsa.pub #查看生成的公匙

如果使用gitlab可能需要配置host(见文章末尾–其他相关)。
2.在github/gitlab上设置公匙,就可以正常使用了。


git常用命令


其他相关

  • windows下Host文件位置
    C:\Windows\System32\drivers\etc\hosts
  • Linux下Host文件位置
    etc/hosts
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章