-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Eric Hsu edited this page Jun 3, 2013
·
19 revisions
Welcome to the git wiki!
整合p4-plug後的使用方式
git p4 sync = fetch
git p4 rebase = pull
git p4 submit = push
- 前置作業,下載p4 command line tool(官網)
cp p4 /usr/bin/ chmod +x /usr/bin/p4
- 下載git-p4.py (https://raw.github.com/erichsu/git/master/git-p4.py)
- 安裝git-p4,範例如下:
cp git-p4.py /usr/bin/git-p4 chmod +x /usr/bin/git-p4
- 修改~/.gitconfig:
[git-p4] port = your_p4_server:1667 user = weikun_lu client = mac.xxxxx_tw skipSubmitEdit = true
- 設定工作環境
- 建立一個目錄(可以是任意位置)作為取出perforce clone的工作複本
mkdir ~/git_p4
- 打開p4 client,將$HOME/git_p4設定為workspace root
- 取得p4 repository的工作路徑
如://Consumer/Project/Dev/MyProject-1.0/MyProject/
- 將工作路徑加到Mappings裡
如://Consumer/Project/Dev/MyProject-1.0/MyProject/… //mac.xxxxx_tw/MyProject/…
- 建立一個目錄(可以是任意位置)作為git的workspace
mkdir ~/p4_git
- 開始將p4的工作複本同步到git
cd ~/p4_git git p4 clone //Consumer/Project/Dev/MyProject-1.0/MyProject/@all MyProject/
(完成以上,即可開始使用git來管理perforce的專案)
- 如何使用p4-integ:
- 下載p4-integ (https://raw.github.com/erichsu/git/master/p4-integ),並加至PATH中
- 編輯~/.profile,並加入下面的參數
export P4USER="your p4 user name" export P4PORT="your p4 server:1667" export P4CLIENT="mac.xxxxx_tw" p4() { if [[ $@ == "integ" ]]; then command p4-integ; else command p4 "$@"; fi; }
- integrate過程中,整合text mate文字編輯器
export EDITOR='mate --wait'