$ arc
Usage Exception: No command provided. Try 'arc help'.
若出現這個錯誤訊息,表示 arc 已經設定成功。
檢查當前檔案狀態
$ git commit -a
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# alan_test.txt
nothing added to commit but untracked files present (use "git add" to track)
$ arc diff
Usage Exception: YOU NEED TO INSTALL A CERTIFICATE TO LOGIN TO PHABRICATOR
You are trying to connect to 'http://phabricator.example.tw/api/' but do not have a certificate installed for this host. Run:
$ arc install-certificate
...to install one.
會發生錯誤是因為尚未設定 certificate 系統通知該做什麼設定。
$ arc install-certificate
Installing certificate for 'http://phabricator.example.tw/api/'...
Trying to connect to server...
Connection OK!
LOGIN TO PHABRICATOR
Open this page in your browser and login to Phabricator if necessary:
http://phabricator.example.tw/conduit/token/
Then paste the token on that page below.
Paste token from that page:
Installing certificate for 'http://phabricator.example.tw/api/'...
Trying to connect to server...
Connection OK!
LOGIN TO PHABRICATOR
Open this page in your browser and login to Phabricator if necessary:
http://phabricator.example.tw/conduit/token/
Then paste the token on that page below.
Paste token from that page: dbl2l5kvjiefbhv2ex--------jsi2idmiktnkswr
Downloading authentication certificate...
Installing certificate for 'alan'...
Writing ~/.arcrc...
SUCCESS! Certificate installed.
設定成功,打開 .arcrc 就會發現設定是 Phabricator 的 user。
再次執行提交
$ arc diff
You have untracked files in this working copy.
Working copy: /home/alan/test/
Untracked files in working copy:
alan_test.txt
Since you don't have '.gitignore' rules for these files and have not listed
them in '.git/info/exclude', you may have forgotten to 'git add' them to your
commit.
Do you want to add this file to the commit? [y/N] y
Enter commit message: alan arc test
接下來會跳轉到輸入詳細的資訊
alan arc test
Summary: my first test
Test Plan: none
Reviewers: webuser
CC:
# Tip: Use "Fixes T123" in your summary to mark that the current revision
# completes a given task.
# NEW DIFFERENTIAL REVISION
# Describe the changes in this new revision.
#
# Included commits in branch master:
#
# 5780b5046d43 alan arc test
#
# arc could not identify any existing revision in your working copy.
# If you intended to update an existing revision, use:
#
# $ arc diff --update <revision>
:wq 儲存後離開會開始提交
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
Updating commit message...
Created a new Differential revision:
Revision URI: http://phabricator.example.tw/D21
Included changes:
A alan_test.txt
$ arc amend
Amending commit message to reflect revision D21: alan arc test.
Closing revision D21 'alan arc test'...
You may now push this commit upstream, as appropriate (e.g. with 'git push',
or 'git svn dcommit', or by printing and faxing it).