Mac 安装git

  1. 打开Mac终端输入git命令

    如果出现以下代码说明已经安装

    usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
    [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
    [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
    [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
    <command> [<args>] These are common Git commands used in various situations: start a working area (see also: git help tutorial)
    clone Clone a repository into a new directory
    init Create an empty Git repository or reinitialize an existing one work on the current change (see also: git help everyday)
    add Add file contents to the index
    mv Move or rename a file, a directory, or a symlink
    restore Restore working tree files
    rm Remove files from the working tree and from the index examine the history and state (see also: git help revisions)
    bisect Use binary search to find the commit that introduced a bug
    diff Show changes between commits, commit and working tree, etc
    grep Print lines matching a pattern
    log Show commit logs
    show Show various types of objects
    status Show the working tree status grow, mark and tweak your common history
    branch List, create, or delete branches
    commit Record changes to the repository
    merge Join two or more development histories together
    rebase Reapply commits on top of another base tip
    reset Reset current HEAD to the specified state
    switch Switch branches
    tag Create, list, delete or verify a tag object signed with GPG collaborate (see also: git help workflows)
    fetch Download objects and refs from another repository
    pull Fetch from and integrate with another repository or a local branch
    push Update remote refs along with associated objects 'git help -a' and 'git help -g' list available subcommands and some
    concept guides. See 'git help <command>' or 'git help <concept>'
    to read about a specific subcommand or concept.
    See 'git help git' for an overview of the system.
  2. 通过homebrew安装git

    1. 未安装homebrew选装homebrew

      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    2. 但是一般情况下报错

      curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

    3. 解决办法:使用国内的镜像(我自己是选择中科技大学)

      /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

    4. 然后提示安装命令行点击安装等待就好

  3. 安装完之后咱们开始一些git的配置

    1. 设置username和email(github每次commit都会记录他们)

      git config --global user.name "wuliqqq"
      git config --global user.email "wuliqqq@outlook.com"
    2. 通过终端命令创建ssh key

      ssh-keygen -t rsa -C "wuliqqq@outlook.com"一直回车直至生成key

    3. 终端查看.ssh/id_rsa.pub文件

      cat .ssh/id_rsa.pub

    4. 登录你的github或者gitee(我自己登录的是gitee)gitee设置ssh key:进入设置界面,点击ssh公钥将你查看的.ssh/id_rsa.pub文件的内容复制进来

      ![image-20200703232954723](/Users/wuliqqq/Library/Application Support/typora-user-images/image-20200703232954723.png)

    5. 可以下载gitee上的项目啦

      git clone https:*//github.com/AlistarChen/LearnGit.git*

Mac中安装Git的更多相关文章

  1. Mac中安装git后,终端运行git出错,提示安装Xcode

    mac用户不使用Xcode安装git之后,默认安装路径是: /usr/local/git 但是在终端运行 git 命令时候的路径是: /usr/bin/git 当我们输入 git 命令时出现如下错误, ...

  2. mac下安装git,并将本地的项目上传到github

    mac下安装git 安装过程: 1.下载Git installer http://git-scm.com/downloads 2.下载之后打开,双击.pkg安装 3.打开终端,使用git --vers ...

  3. Mac中安装maven3.2.1

    Mac中安装maven3.2.1 原文链接:http://blog.csdn.net/f_zongjian/article/details/24144803 本机OS X:10.9,未安装XCode, ...

  4. Git—怎样Windows操作系统中安装Git

    介绍一下怎样在Windows操作系统中安装Git: 一.下载Git安装压缩文件:http://download.csdn.net/detail/wangshuxuncom/8035045 二.解压该压 ...

  5. 在mac中安装tmux

    在mac 中安装Tmux: 在终端输入如下命令: brew  install tmux Tmux 的快捷键前缀(Prefix) 为了使自身的快捷键和其他软件的快捷键互不干扰,Tmux 提供了一个快捷键 ...

  6. idea中安装git后,代码颜色代表的含义

    idea中安装git以后,代码文件出现了不同的颜色 它们分别表示的含义: 绿色,已经加入控制暂未提交 红色,未加入版本控制 蓝色,加入,已提交,有改动 白色,加入,已提交,无改动 灰色:版本控制已忽略 ...

  7. Mac OS 安装 Git 环境

    1. 在mac的终端上,输入git会提示安装git软件,确认安装.安装完成后打开终端,使用git --version或者which git命令查看安装版本,有就是安装成功了. 2. 创建一个全局用户名 ...

  8. mac 中使用git 和pycharm提交项目

    一.安装Git 1.验证git是否安装: 终端中输入: git 如果安装过出现: 2.安装git: 进入https://git-scm.com: 点击 Download 2.23.0 for Mac ...

  9. Mac中安装Vim7.4

    Mac上的Vim Mac本身其实是预装了Vim的,但是目前的系统中都是Vim7.3版本的,而最新的Vim已经是7.4版了,因此为了能够使用最新版的vim,必须要对Mac中的vim要么升级,要么重装.在 ...

随机推荐

  1. C# 学习第七天

    P96 面向对象的概念 ①先有的 面向过程 --------> 然后才衍生出面向对象的思想 ②面向过程:面向的是完成这件事儿的过程,强调的是完成这件事儿的动作 比如说 把大象塞进冰箱去 ③面向过 ...

  2. javaScript继承的几种实现方式?

    js继承总共分成5种,包括构造函数式继承.原型链式继承.组合式继承.寄生式继承和寄生组合式继承. 构造函数式继承 首先来看第一种,构造函数式继承,顾名思义,也就是利用函数去实现继承:构造函数继承,使用 ...

  3. C 语言运算符与分支循环小记

    1. 前导内容 · 使用sizeof()统计各种数据类型占用字节数 · 进制转换问题 · if语句基本语法 · switch语句基本语法 2. 运算符 · 基本概念 · 左值 右值 · 优先级结合性 ...

  4. JQuery生成二维码,有资源下载

    原文链接:http://www.yxxrui.cn/article/65.shtml 没时间或者懒得看的,可以直接看加粗部分(或试试手感▼). 使用jquery.qrcode来生成二维码,qrcode ...

  5. 如何写出安全的、基本功能完善的Bash脚本

    每个人或多或少总会碰到要使用并且自己完成编写一个最基础的Bash脚本的情况.真实情况是,没有人会说"哇哦,我喜欢写这些脚本".所以这也是为什么很少有人在写的时候专注在这些脚本上. ...

  6. java 常用时间操作类,计算到期提醒,N年后,N月后的日期

    package com.zjjerp.tool; import java.text.ParseException; import java.text.ParsePosition; import jav ...

  7. Git设置记住账号密码

    Git设置记住账号密码 添加如下配置 [credential] helper = store

  8. MRP物料需求计划

    1.重订货点的采购计划. 计算方式:再订货点的库存数量 = 安全库存 + 采购提前期 * 每天消耗的数量 一旦库存数量触及再订货点的库存数量,需触发采购订单订购物料,理想的情况下 ,下次到采购订单收货 ...

  9. 【探索之路】机器人篇(4)-根据3D文件来优化自己的机器人模型

    此章节不是必须做的!!!! 因为我已经用solidworks画了机器人的3D模型,那我就直接导入已经画好的三维模型. 如果大家没有画也是可以直接使用上一章节我们已经构建的机器人模型.我这里只是一个对显 ...

  10. 为什么Java中lambda表达式不能改变外部变量的值,也不能定义自己的同名的本地变量呢?

    作者:blindpirate链接:https://www.zhihu.com/question/361639494/answer/948286842来源:知乎著作权归作者所有.商业转载请联系作者获得授 ...