From: Nicolas Boisselier Date: Tue, 6 Dec 2016 17:39:10 +0000 (+0000) Subject: git X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=bf57de1e93d74ffcfcadbeb07a5160f97d9bc703;p=nb.git git --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index e15041f9..c6883365 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -9,10 +9,11 @@ alias git_ls_tree="git ls-tree --full-tree -r HEAD" alias git_ls_files="git ls-files" git_pull_reset() { - local branch='origin/master' + local branch=$(git branch --list|awk '/\*/{print $2; exit}') [ -n "$1" ] && branch="$1" + [ -z "$branch" ] && return git fetch --all - git reset --hard $branch + git reset --hard "$branch" } git_log_files() {