Mac--Git安装
注意:在安装Git前,可先安装homebrew,应用brew命令安装Git即可。
一。Mac 安装homebrew
参考博客:https://blog.csdn.net/yuexiaxiaoxi27172319/article/details/51279369
Homebrew官网 http://brew.sh/index_zh-cn.html
说明:Homebrew简称brew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件,可以说Homebrew就是mac下的apt-get、yum神器
1。Homebrew安装
//打开终端,输入命令
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2。Homebrew使用
//搜索软件:
brew search 软件名,如brew search wget
//安装软件:
brew install 软件名,如brew install wget
//卸载软件:
brew remove 软件名,如brew remove wget brew uninstall 软件名,如brew uninstall wget
3。Homebrew安装成功显示如下:
centlingdeMacBook-Pro:openssl-1.0.2g centling$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir /usr/local
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local
==> /usr/bin/sudo /usr/sbin/chown centling:admin /usr/local
==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown centling /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 458, done.
remote: Compressing objects: 100% (416/416), done.
remote: Total 458 (delta 28), reused 277 (delta 17), pack-reused 0
Receiving objects: 100% (458/458), 701.87 KiB | 116.00 KiB/s, done.
Resolving deltas: 100% (28/28), done.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
HEAD is now at 496fff6 doco: more updates for core/formula separation
==> Tapping homebrew/core
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3660, done.
remote: Compressing objects: 100% (3545/3545), done.
remote: Total 3660 (delta 17), reused 425 (delta 3), pack-reused 0
Receiving objects: 100% (3660/3660), 2.75 MiB | 375.00 KiB/s, done.
Resolving deltas: 100% (17/17), done.
Checking connectivity... done.
Tapped 3535 formulae (3,686 files, 8.6M)
==> Installation successful!
==> Next steps
Run `brew help` to get started
centlingdeMacBook-Pro:openssl-1.0.2g centling$
二。应用brew安装Git版本控制工具
参考博客:https://blog.csdn.net/xiaohanluo/article/details/53214933
1。打开终端,输入命令:brew install git
2。安装好Git后,配置用户名和用户邮箱,以后每次与Git的交互都会使用该信息
git config --global user.name "your_name"
git config --global user.email "your_email@gmail.com"
配置信息可以更改,以后想要更改使用上面指令就可以。同时可以使用git config --list
指令查看Git的配置信息。
Git默认是大小写不敏感的,也就是说,将一个文件名某个字母做了大小写转换的修改Git是忽略这个改动的,导致在同步代码时候会出现错误,所以建议大小把Git设置成大小写敏感。
git config core.ignorecase false
相关Git学习参考博客:
https://blog.csdn.net/xiaohanluo/article/details/53214933
Git教程,里面有介绍到Git的工作原理,可以仔细阅读。
Git Community Book 中文版介绍了Git具体使用,这本书也是关于Git的一本好书。
Git练习,实战练习Git的各种指令