參考鏈接:http://www.cnblogs.com/lzrabbit/p/4032515.html
Homebrew官網 http://brew.sh/index_zh-cn.html
(一)介紹,Homebrew是神馬
Linux系統(tǒng)有個讓人蛋疼的通病,軟件包依賴,好在當前主流的兩大發(fā)行版本都自帶了解決方案,Red hat有yum,Ubuntu有apt-get
神馬,你用mac os,不好意Mac os木有類似的東東,淚奔中幾經折騰總算找到了第三方支持:Homebrew,Homebrew簡稱brew,是Mac OSX上的軟件包管理工具,能在Mac中方便的安裝軟件或者卸載軟件,可以說Homebrew就是mac下的apt-get、yum神器
Homebrew安裝
Homebrew的安裝非常簡單,打開終端復制、粘貼以下命令,回車,搞定(請放心使用,原汁原味的官方安裝方法搬運)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
ps:不知道為什么執(zhí)行這個命令有時會返回400,估計可能被墻了,過幾分鐘重試下一般就ok了,有圖有真相
Homebrew使用
Homebrew使用沒啥好說的了,常用的
搜索軟件:brew search 軟件名,如brew search wget
安裝軟件:brew install 軟件名,如brew install wget
卸載軟件:brew remove 軟件名,如brew remove wget
更多的?自己去官網挖吧 http://brew.sh/index_zh-cn.html
(二)開始安裝,先裝brew,后再安裝Git 或 yasm
mac上自帶git,老系統(tǒng)可按下面步驟進行,整理一下整個流程為:
如果沒有git先安裝:
mac上使用Homebrew來安裝或卸載軟件,命令:
# install homebrew, git, yasm
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install yasm
git的基本使用方法
1.進入一個目錄,為了創(chuàng)建git本地倉庫
cd /Users/yuchen/Desktop/工作
2.選擇要clone的git地址,這里使用我的測試地址
git clone https://github.com/yuchen931201/android01.git
3.為了查看當前目錄的文件
yuchendeMacBook-Pro:工作 yuchen$ git branch -a
fatal: Not a git repository (or any of the parent directories): .git
yuchendeMacBook-Pro:工作 yuchen$ ls
4.查看master
yuchendeMacBook-Pro:工作 yuchen$ cd android01/
yuchendeMacBook-Pro:android01 yuchen$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
5.為了對比新增了哪些文件,或者哪些文件有修改
yuchendeMacBook-Pro:android01 yuchen$ git status
6.先將要更新的文件add,再commit,-m為添加更新日志,最后輸入賬號密碼
yuchendeMacBook-Pro:android01 yuchen$ git add .
yuchendeMacBook-Pro:android01 yuchen$ git commit -m"add json.rtf"
Username for 'https://github.com': yuchen931201***
Password for 'https://yuchen931201@github.com':**t2!**