## 常用命令
設置用戶名
`$ git config --global user.name "Your Name"`
設置郵箱
`$ git config --global user.email "email@example.com"`
創建git倉庫
`$ git init`
忽略提交文件
~~~
根目錄創建一個名為 .gitignore 的文件
# 此為注釋 – 將被 Git 忽略
*.a # 忽略所有 .a 結尾的文件
!lib.a # 但 lib.a 除外
/TODO # 僅僅忽略項目根目錄下的 TODO 文件,不包括 subdir/TODO
build/ # 忽略 build/ 目錄下的所有文件
doc/*.txt # 會忽略 doc/notes.txt 但不包括 doc/server/arch.txt
~~~
添加文件到倉庫
`$ git add`
提交到倉庫
`$ git commit -m "wrote a readme file"`
從命令行推送已經創建的倉庫
~~~
git remote add origin http://git.metroo.com.cn/zz52998/yikaiba.git
git push -u origin master
~~~