Created
September 11, 2018 18:57
-
-
Save chhh/e1d8b9559291b0f7bacda8e9e3ca8dfe to your computer and use it in GitHub Desktop.
Bashrc for git on Windows installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from: https://github.com/bobthecow/git-flow-completion/blob/master/git-flow-completion.bash | |
source ~/git-flow-completion.bash | |
if [[ -n "${ConEmuPID}" ]]; then | |
PS1="$PS1\[\e]9;9;\"\w\"\007\e]9;12\007\]" | |
fi | |
# This is used to start ssh-agent once when git-bash is started. | |
# Saves typing the ssh key password every time you interact with | |
# a remote repo. | |
env=~/.ssh/agent.env | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { | |
(umask 077; ssh-agent >| "$env") | |
. "$env" >| /dev/null ; } | |
agent_load_env | |
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running | |
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?) | |
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then | |
agent_start | |
ssh-add | |
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then | |
ssh-add | |
fi | |
unset env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment