1. 安裝 XQuartz X11 server
2. 設定 sshd 的 config 讓它支援 xforwarding
Host *
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
3. 利過 ssh -Y (or -X) plateau@xxx.xx.xxx 連到遠端的主機上
ps. 設定 xterm 的字型大小可以用下面指令開啟 app
xterm -fa 'Monospace' -fs 12&
Host *
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
2. 在 ~/.bash_profile 中加入下面的 script
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
然後重新載入一下 .bash_profile 就可以了。
第二件事是讓 terminal 的 prompt 可以顯示目前是在哪個分支。
方法也很簡單,在 PS1 這個變數中,適當的位置加入
\$(__git_ps1) 就可以了。
像我的設法是:
export PS1='\[\e[36;1m\][\h]\[\e[33;1m\]\t \[\e[0m\]\[\e[32;1m\]\w \[\e[0m\]$(__git_ps1 "(%s)")\n$'
REF:
1. http://code-worrier.com/blog/autocomplete-git/
2. http://code-worrier.com/blog/git-branch-in-bash-prompt/
昨天從圖書館借的書,一口氣把它看完了。很特別的題材,在講老人的社會問題,以及人為什麼不行自行決定生死,只能在醫院拖著已經殘破不堪的身體,直到最後短氣的那一刻。 書中還有提到想成為女生的男生,以及透過網路可以達到的一些社群效果。算是把一些現代的元素組合得蠻好的作品。 推薦。