diff --git a/.bashrc b/.bashrc index f16ee39..81296bc 100644 --- a/.bashrc +++ b/.bashrc @@ -27,3 +27,7 @@ git_prompt () # Thy holy prompt. PROMPT_COMMAND='PS1="${c_user}\u${c_reset}@${c_user}\h${c_reset}:${c_path}\w${c_reset}$(git_prompt)\$ "' +# change working directory to root of repo +git-root() { + cd "$(git proot)" +} diff --git a/README.md b/README.md index ef542dd..261b3b3 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,7 @@ Inny sposób prezentacji wszystkich branchy - jeszcze bardziej szczegółowy git branches +Zmiana aktywnego katalogu na główny katalog repozytorium (komenda basha) + + git-root + diff --git a/config b/config index 578ccca..efd99b9 100644 --- a/config +++ b/config @@ -84,6 +84,10 @@ # Check if any file in repo has whitespace errors # As described in http://peter.eisentraut.org/blog/2014/11/04/checking-whitespace-with-git/ check-whitespace = !git diff-tree --check $(git hash-object -t tree /dev/null) HEAD + + # for git-root command + proot = !pwd + [apply] whitespace = nowarn [core]