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要么升级,要么重装.在 ...
随机推荐
- YouZack英语学习网站,英语四六级的福音
YouZack英文网站 YouZack英语网站是,杨中科大佬开发给各位有需要的人使用的一个英语学习网站: 网站分两个模块: 听力模块部分图 听力模块界面 听力模块使用说明界面 背单词模块部分图 背单词 ...
- 最详细10招Spark数据倾斜调优
最详细10招Spark数据倾斜调优 数据量大并不可怕,可怕的是数据倾斜 . 数据倾斜发生的现象 绝大多数 task 执行得都非常快,但个别 task 执行极慢. 数据倾斜发生的原理 在进行 shuff ...
- python监控文件实时批量压缩脚本
# coding:utf-8 from shutil import make_archive import os import time # 指定需要监测的文件夹 image_path = './im ...
- angular8 大地老师学习笔记
第一课: angular 创建项目命令: ng new 项目名称 创建组件: ng g 可查看所有创建的对象 ,ng g component components/home 创建组件,后面跟的是 ...
- kubernetes环境搭建 -k8s笔记(一)
一.环境准备 1.硬件及版本信息: cpu&内存:2核心,2G 网络: 每台vm主机2块网卡,一块NAT用于上网,别一块配置成 "仅主机模式",网段为192.168.100 ...
- Java 从 Map 到 HashMap 的一步步实现
Java 从 Map 到 HashMap 的一步步实现 一. Map 1.1 Map 接口 在 Java 中, Map 提供了键--值的映射关系.映射不能包含重复的键,并且每个键只能映射到一个值. 以 ...
- C# 9 新特性——init only setter
C# 9 新特性--init only setter Intro C# 9 中新支持了 init 关键字,这是一个特殊的 setter,用来指定只能在对象初始化的时候进行赋值,另外支持构造器简化的写法 ...
- jsp文件导包
可以在一个页面中用上多个<% @ page %>指令,但是其中的属性只能用一次,不过也有个例外,那就是import属性.因为import属性和Java中的import语句差不多(参照Jav ...
- 求你别再用swagger了,给你推荐几个在线文档生成神器
前言 最近公司打算做一个openapi开放平台,让我找一款好用的在线文档生成工具,具体要求如下: 必须是开源的 能够实时生成在线文档 支持全文搜索 支持在线调试功能 界面优美 说实话,这个需求看起来简 ...
- Windows系统设置多用户同时远程登录
一.在键盘上按Win+R键(也可以在开始菜单右键然后选择运行),在运行的输入框里面输入"gpedit.msc"命令.然后点击确定 二.在"计算机组策略"中依次展 ...