Mac中安装Git
Mac 安装git
打开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.
通过homebrew安装git
未安装homebrew选装homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
但是一般情况下报错
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
解决办法:使用国内的镜像(我自己是选择中科技大学)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
然后提示安装命令行点击安装等待就好
安装完之后咱们开始一些git的配置
设置username和email(github每次commit都会记录他们)
git config --global user.name "wuliqqq"
git config --global user.email "wuliqqq@outlook.com"
通过终端命令创建ssh key
ssh-keygen -t rsa -C "wuliqqq@outlook.com"一直回车直至生成key
终端查看.ssh/id_rsa.pub文件
cat .ssh/id_rsa.pub
登录你的github或者gitee(我自己登录的是gitee)gitee设置ssh key:进入设置界面,点击ssh公钥将你查看的.ssh/id_rsa.pub文件的内容复制进来

可以下载gitee上的项目啦
git clone https:*//github.com/AlistarChen/LearnGit.git*
打开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.
通过homebrew安装git
未安装homebrew选装homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"但是一般情况下报错
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused解决办法:使用国内的镜像(我自己是选择中科技大学)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"然后提示安装命令行点击安装等待就好
安装完之后咱们开始一些git的配置
设置username和email(github每次commit都会记录他们)
git config --global user.name "wuliqqq"
git config --global user.email "wuliqqq@outlook.com"
通过终端命令创建ssh key
ssh-keygen -t rsa -C "wuliqqq@outlook.com"一直回车直至生成key终端查看
.ssh/id_rsa.pub文件
cat .ssh/id_rsa.pub登录你的github或者gitee(我自己登录的是gitee)gitee设置ssh key:进入设置界面,点击ssh公钥将你查看的
.ssh/id_rsa.pub文件的内容复制进来
可以下载gitee上的项目啦
git clone https:*//github.com/AlistarChen/LearnGit.git*
Mac中安装Git的更多相关文章
- Mac中安装git后,终端运行git出错,提示安装Xcode
mac用户不使用Xcode安装git之后,默认安装路径是: /usr/local/git 但是在终端运行 git 命令时候的路径是: /usr/bin/git 当我们输入 git 命令时出现如下错误, ...
- mac下安装git,并将本地的项目上传到github
mac下安装git 安装过程: 1.下载Git installer http://git-scm.com/downloads 2.下载之后打开,双击.pkg安装 3.打开终端,使用git --vers ...
- Mac中安装maven3.2.1
Mac中安装maven3.2.1 原文链接:http://blog.csdn.net/f_zongjian/article/details/24144803 本机OS X:10.9,未安装XCode, ...
- Git—怎样Windows操作系统中安装Git
介绍一下怎样在Windows操作系统中安装Git: 一.下载Git安装压缩文件:http://download.csdn.net/detail/wangshuxuncom/8035045 二.解压该压 ...
- 在mac中安装tmux
在mac 中安装Tmux: 在终端输入如下命令: brew install tmux Tmux 的快捷键前缀(Prefix) 为了使自身的快捷键和其他软件的快捷键互不干扰,Tmux 提供了一个快捷键 ...
- idea中安装git后,代码颜色代表的含义
idea中安装git以后,代码文件出现了不同的颜色 它们分别表示的含义: 绿色,已经加入控制暂未提交 红色,未加入版本控制 蓝色,加入,已提交,有改动 白色,加入,已提交,无改动 灰色:版本控制已忽略 ...
- Mac OS 安装 Git 环境
1. 在mac的终端上,输入git会提示安装git软件,确认安装.安装完成后打开终端,使用git --version或者which git命令查看安装版本,有就是安装成功了. 2. 创建一个全局用户名 ...
- mac 中使用git 和pycharm提交项目
一.安装Git 1.验证git是否安装: 终端中输入: git 如果安装过出现: 2.安装git: 进入https://git-scm.com: 点击 Download 2.23.0 for Mac ...
- Mac中安装Vim7.4
Mac上的Vim Mac本身其实是预装了Vim的,但是目前的系统中都是Vim7.3版本的,而最新的Vim已经是7.4版了,因此为了能够使用最新版的vim,必须要对Mac中的vim要么升级,要么重装.在 ...
随机推荐
- 网站开发学习Python实现-Django学习-总结(6.1.2)
@ 目录 1.MVT 2.模型 3.视图 4.模板 5.常用的命令 6.pycharm创建django工程 关于作者 1.MVT 项目结构如下,其中项目同名文件夹为配置文件 每一个项目有多个应用(未考 ...
- 神奇的BFC
BFC是什么? 块格式化上下文(Block/box Formatting Context,BFC) 是Web页面的可视CSS渲染的一部分,是块盒子的布局过程发生的区域,也是浮动元素与其他元素交互的区域 ...
- 很多人不知道的Python 炫技操作:条件语句的写法
有的人说 Python 是一门 入门容易,但是精通难的语言,这一点我非常赞同. Python 语言里有许多(而且是越来越多)的高级特性,是 Python 发烧友们非常喜欢的.在这些人的眼里,能够写出那 ...
- os模块和os.path模块常用方法
今天和大家分享python内置模块中的os模块和os.path模块. 1.什么是模块呢? 在计算机开发过程中,代码越写越多,也就越来越难以维护,所以为了可维护的代码,我们会把函数进行分组,放在不同的文 ...
- spring-quartz整合
摘要 spring ,springboot整合quartz-2.3.2,实现spring管理jobBean 本文不涉及 JDBC存储的方式,springboot yml配置也没有 可自行百度 谷歌 本 ...
- 解决在Filter中读取Request中的流后, 然后再Control中读取不到的做法
摘要: 大家知道, StringMVC中@RequestBody是读取的流的方式, 如果在之前有读取过流后, 发现就没有了. 我们来看一下核心代码: filter中主要做的事情, 就是来校验请求是否合 ...
- 【目标检测】基于传统算法的目标检测方法总结概述 Viola-Jones | HOG+SVM | DPM | NMS
"目标检测"是当前计算机视觉和机器学习领域的研究热点.从Viola-Jones Detector.DPM等冷兵器时代的智慧到当今RCNN.YOLO等深度学习土壤孕育下的GPU暴力美 ...
- 基于socket的netty demo
前面一文说了 基于http的netty demo 和http不一样,http可以用浏览器来充当客户端调用,所以基于socket的netty,必须要编写客户端和服务器的代码 实现功能: 客户端给服务器发 ...
- SAML和OAuth2这两种SSO协议的区别
目录 简介 SAML SAML的缺点 OAuth2 OAuth2的缺点 两者的对比 CAS简介 简介 SSO是单点登录的简称,常用的SSO的协议有两种,分别是SAML和OAuth2.本文将会介绍两种协 ...
- ROS开源小车TurtleBot3详情介绍(Burger)
您为什么要选择ROS开源智能小车 ROS(RobotOperating System,机器人操作系统)是目前世界上更主流更多人使用的的机器人开源操作系统.它可以提供操作系统应有的服务,包括硬件抽象,底 ...