zoukankan      html  css  js  c++  java
  • Begin using git (Part1)

    Git提供了适用于Linux, Windows, OSX的客户端, 本节以Windows为例介绍基本安装与配置。

    所需工具:msysgit, kdiff3.

    在Windows Explorer任意目录下,右键菜单选择Git bash here,进入Git command prompt.

    配置身份信息:

    $ git config --global user.name "John Doe"

    $ git config --global user.email johndoe@example.com

    配置合并工具:

    $ git config --global merge.tool kdiff3

    $ git config --global mergetool.kdiff3.path "your path to kdiff3.exe"

    根据提示配置ssh:

    • 检查是否已配置SSH, 如果已经配置,下述命令将会返回类似id_rsa, id_rsa.pub的数个文件。

        $ ls ~/.ssh

    • 生成public/private key。根据提示跳过密码可以留空。

          $ ssh-keygen -t rsa -b 4096 -C "your-email@example.com"

    • 确保ssh-agent打开。

          $ ssh-agent -s

    • 添加private key到ssh-agent。

        $ ssh-add ~/.ssh/id_rsa

    • 拷贝public key至剪贴板,并粘贴进Remote server profile中。

            $ clip < ~/.ssh/id_rsa.pub

        例如在github中可以在profile->personal settings中可以找到 SSH Keys菜单:

        

    至此基本配置完成,可以使用预配置的身份clone仓库,提交代码,以及更多。

  • 相关阅读:
    阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:8. 委托事件
    阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:7. 服务调用
    Git
    Git
    Git
    Git
    Git
    Git
    Git
    Delphi
  • 原文地址:https://www.cnblogs.com/500error/p/begin-using-git-part-1.html
Copyright © 2011-2022 走看看