星期五, 五月 15, 2009
Git 基礎設定 (帳號的環境參數設定)
Git 基本環境設定, 主要是設定自己帳號下的環境參數.
基本資料設定
直接於 Shell 下執行下述:
- git config --global user.name "Tsung"
- git config --global user.email "username@email.com"
- git config --global color.diff auto # git diff 要顯示顏色
- git config --global color.status auto # git status 要顯示顏色
- git config --global color.branch auto
- git config --global color.log auto # git log --graph 會很漂亮, 感謝日落提供.
- 註: 這些設定會在 ~user/ 下產生 .gitconfig
[color]
diff = auto
status = auto
branch = auto
log = auto
[user]
name = Tsung
email = username@email.com
Git 自動忽略檔案 / 目錄設定
要自動將某些檔案掠過不 Commit, 要設定 .gitignore 這個檔案. (哪些檔案是不要 commit 進去的)
- vim .gitignore
tmp/**/*
log/*
config/database.yml -
使用
git add .
等, 這些都不會將這些資料列入 commit. (.gitignore 會被列入 commit)
修改預設目錄
預設會產生 .git 目錄, 改成 .test
- 修改 Shell 變數 GIT_DIR =>
export GIT_DIR=.test
相關網頁
相關標籤
可以再加一個設定:
git config --global color.log auto
這樣 git log --graph 會很漂亮 :P
Comment by
日落
(03/07/2010 23:07)
發表迴響
PS: 若無法留言, 請先確認是否有打開 JavaScript, 造成您的困擾, 實在萬分對不起 Orz...(如果無法留言, 勞煩可以發信給我好嗎? 謝謝.)
PS2: 若您的留言被誤判, 我都會再自行看過, 不需要一直重覆張貼~
PS2: 若您的留言被誤判, 我都會再自行看過, 不需要一直重覆張貼~




