鍍金池/ 教程/ iOS/ Git and Github
Apps
Node.js
Git and Github
MySQL
iTerm2
Homebrew
XCode
系統(tǒng)設(shè)置

Git and Github

作為一名開發(fā)者怎么可能沒有 Git 呢? 我們馬上就來安裝:

$ brew install git  

好的,現(xiàn)在我們來測試一下 git 是否安裝完好:

$ git --version  

運行 $ which git 將會輸出 /usr/local/bin/git.

接著,我們將定義你的 Git 帳號(與你在 GitHub 使用的用戶名和郵箱一致)

$ git config --global user.name "Your Name Here"
$ git config --global user.email "your_email@youremail.com"  

這些配置信息將會添加進(jìn) ~/.gitconfig 文件中.

我們將推薦使用 HTTPS 方法(另一個是 SSH),將你的代碼推送到 Github 上的倉庫。如果你不想每次都輸入用戶名和密碼的話,可以按照此 描述 說的那樣,運行:

$ git config --global credential.helper osxkeychain 

此外,如果你打算使用 SSH 方式,可以參考此 鏈接.

Git Ignore

創(chuàng)建一個新文件 ~/.gitignore ,并將以下內(nèi)容添加進(jìn)去,這樣全部 git 倉庫將會忽略以下內(nèi)容所提及的文件。

\# Folder view configuration files
.DS_Store
Desktop.ini

\# Thumbnail cache files
._*
Thumbs.db

\# Files that might appear on external disks
.Spotlight-V100
.Trashes

\# Compiled Python files
*.pyc

\# Compiled C++ files
*.out

\# Application specific files
venv
node_modules
.sass-cache  
上一篇:系統(tǒng)設(shè)置下一篇:Apps