直接从AppStore安装Xcode,Xcode集成了Git,不过默认没有安装,你需要运行Xcode,选择菜单“Xcode”->“Preferences”,在弹出窗口中找到“Downloads”,选择“Command Line Tools”,点“Install”就可以完成安装了。 安装完成之后,直接在命令行里面输入git –version
ssh-keygen -t rsa -C FreweniUbuntu ssh-keygen -t rsa -C FreweniMacKey ssh-keygen -t rsa -C FreweniUbuntuBookKey ssh-keygen -t rsa -C FreweniBaiduMacKey #输出的对应信息如下: FreweniMac:~ frewen$ ssh-keygen -t rsa -C FreweniMacKey Generating public/private rsa key pair. Enter file in which to save the key (/Users/frewen/.ssh/id_rsa): Created directory '/Users/frewen/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/frewen/.ssh/id_rsa. Your public key has been saved in /Users/frewen/.ssh/id_rsa.pub. The key fingerprint is: SHA256:PZBSQvCcI5uXRNReSfwYEx6V1Jhn+o3AFrx0Hg70BM0 Frewen.Wong The key's randomart image is: +---[RSA 2048]----+ | .+=..o+B=O. | | + +.o*.OoE | | . B.o..B @.. | | = +.o. B o | | o o S o. o o | | . . o .| | | | | | | +----[SHA256]-----+ FreweniMac:~ frewen$ FreweniMac:~ frewen$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDwwe2sJ5dW269cBFSupiQAQSw4W7sEUiLXo1M4hHLFQ 1/HsZVyz75tbYBX6WIdwT8jEl3tJJNku5nIPI9MsudklWssR3T32gTZ32yuvF7b005kBGA5RE/oj/nfbLFB9Ubkakyyi 7o+e7CPVTARGuTdz4VraVpp/NXrnTD5tzexXcTOAgA1fm5KApi2z54hgyKXhI7vl3nT36WzO0+u1lXbmHAd6rRZ8X6+2QB278Fd7caiY fr3AzmT+gCTsoaW9nPvpNGiP06Wr2jYCQ7YuaP9azPzKYWM2X7pKhXESTadtmQakFnfiMOPX92GGmOcbzX6zyc6JxvFwWXt161nq15 FreweniMacKey