LoginSignup
0
2

More than 5 years have passed since last update.

AzureポータルのBashにGitを設定する

Last updated at Posted at 2017-05-11

Azure Portal上で Cloud Shell (Bash) が使えるようになりましたので、
早速Gitの設定を行いました。

Gitコマンドのタブ補完とステータス表示です。

ここから開きます。
image

.bashrc に以下を追加します。

  • Gitコマンドのタブ補完
source /usr/share/bash-completion/completions/git
  • ブランチ名とステータス表示
source /etc/bash_completion.d/git-prompt

PS1を以下に書き換えます。お好みに合わせて変更して下さい。

PS1='\[\033[32m\]\u@Azure \[\033[33m\]\w\[\033[36m\]$(__git_ps1 " (%s)")\[\033[0m\]\n$ '

以下を追加します。
Modify, Untracked, Stash, originより進んでいる遅れている状態の表示を有効にします。

GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUPSTREAM=auto

詳しくはgit-promptでググって下さい。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2