1.  初次安装git配置用户名和邮箱


$ git config --global user.name "xxx"

$ git config --global user.email "[email protected]"

2. git使用ssh**


$ ssh-****** -t rsa -C "[email protected]"

git ssh**配置添加

3.生成**对

cat ~/.ssh/id_rsa.pub

ssh-rsa B3NzaC1yc2EAAAADAQABAAABAQDDLFAvtyxdR0TGyLHsSDFk/PjBbG2QIqNiyuStWrOy1bjL/c615lLjWS26zVf++zI6d7Vdcfrc/L7YRMng099O3CunXVYmlaRJj5Uii0IW6/dFZPmCa2QtAOvuJRJLGKtGLa6vxvqMwvUzsvHz64QCzXIotcFlewKKTlRvrxArOuwEskgcX7/Vr71XZoaz72Bs4LSTZ6NQPrfkbb6ku0hws9ERy2wtnoSpo2wkXkODvdzpDtuxAIYQhxnLEMHyWkvCG9RVW6UDkHWpf9+KbJWzKz9g0I1CC58iDP3BBkr/O+hBT7/inFSD

 

4. 添加公钥到你的远程仓库(github)

     远程添加完后验证


$ ssh -T [email protected]

Hi xxx! You've successfully authenticated, but GitHub does not # provide shell access.

成功

 

5、修改git的remote url

$ git remote -v
origin https://github.com/someaccount/someproject.git (fetch) origin https://github.com/someaccount/someproject.git (push)

  


相关文章:

  • 2022-12-23
  • 2021-04-03
  • 2021-07-25
  • 2021-09-15
  • 2021-05-22
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2021-07-08
  • 2021-07-01
  • 2021-11-18
  • 2021-06-10
  • 2021-11-05
  • 2021-09-09
相关资源
相似解决方案