Open1

Git for Windows 用 .bashrc

.bashrc
export LANG=ja_JP.UTF8
export PATH="$HOME/bin:$PATH"

# https://github.com/scop/bash-completion/releases
#
# scoop install make
# xz -dv bash-completion-2.X.tar.xz
# tar xvf bash-completion-2.X.tar
# cd bash-completion-2.X
# ./configure
# make && make install
#
if [ -f /usr/local/share/bash-completion/bash_completion ]; then
  source /usr/local/share/bash-completion/bash_completion
fi

# curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
if [ -f $HOME/.bash/git-completion.bash ]; then
  source $HOME/.bash/git-completion.bash
fi

# curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
if [ -f $HOME/.bash/git-prompt.sh ]; then
  source $HOME/.bash/git-prompt.sh  
  GIT_PS1_SHOWDIRTYSTATE=true
  GIT_PS1_SHOWUNTRACKEDFILES=true
  GIT_PS1_SHOWSTASHSTATE=true
  GIT_PS1_SHOWUPSTREAM=auto
  export PS1="\[\e[32m\]\u\[\e[0m\]:\[\e[38;5;012m\]\w\[\e[0m\]\[\e[38;5;037m\]`__git_ps1`\[\e[0m\]\n$ "
else
  export PS1="\[\e[32m\]\u\[\e[0m\]:\[\e[38;5;012m\]\w\[\e[0m\]\n$ "
fi

add_line() {
  if [[ -z "${PS1_NEWLINE_LOGIN}" ]]; then
    PS1_NEWLINE_LOGIN=true
  else
    printf "\n"
  fi
}
PROMPT_COMMAND="add_line"

gas() {
  git add -A;
  git status;
}

gap() {
  git add -p ${@:1}
}

alias ls="ls -F --color=auto --ignore=NTUSER* --ignore=ntuser* --ignore=*.ini"
alias la="ls -a"
alias ll="ls -l"
alias lla="ls -la"

alias gcm="git commit -m"
alias gcam="git commit --amend -m"
alias gra="git reset HEAD"
alias grc="git reset --soft HEAD~"
alias grs="git restore ."
alias gl="git log --oneline"

alias ytdl="youtube-dl -f mp4"
ログインするとコメントできます