配置Git绑定Git@OSC

来源:互联网 发布:c语言cos函数怎么表示 编辑:程序博客网 时间:2024/06/07 03:12
  1. 用户名,这个名字会出现在以后的提交记录中。
    git config --global user.name "Git@OSC用户名"

  2. 然后是Email,同样,这个Email也会出现在你的提交记录中,此Email要与Git@OSC的注册Email一致。
    git config --global user.email "Git@OSC账号"

  3. 生成SSH key
    SSH key 可以让你在你的电脑和 Git @ OSC 之间建立安全的加密连接。
    ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
    # Creates a new ssh key using the provided email
    # Generating public/private rsa key pair...

  4. 查看你的public key,并把他添加到 Git @ OSC 【http://git.oschina.net/keys】
    cat ~/.ssh/id_rsa.pub
    会看到格式如

    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc….

    的输出,复制它们添加到上面的网址。

  5. 最后输入ssh -T git@git.oschina.net,若返回

    Welcome to Git@OSC, yourname!

    则证明添加成功。

参考:https://git.oschina.net/oschina/git-osc/wikis/%E5%B8%AE%E5%8A%A9#ssh-keys

0 0