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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章