mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Add toroot function to fast changing workdir to repo's root
If we are not in repo, just call `cd` with no arguments (which in most cases move us to home dir). Maybe will be better to do nothing otherwise?
This commit is contained in:
parent
ee14d5fa59
commit
e13736091c
1 changed files with 5 additions and 0 deletions
|
|
@ -60,6 +60,11 @@ function current_repository() {
|
|||
echo $(git remote -v | cut -d':' -f 2)
|
||||
}
|
||||
|
||||
# change workdir to repo's root (or do `cd` with no arguments if not in a repo)
|
||||
function toroot() {
|
||||
builtin cd "`git_get_root`"
|
||||
}
|
||||
|
||||
# these aliases take advantage of the previous function
|
||||
alias ggpull='git pull origin $(current_branch)'
|
||||
compdef ggpull=git
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue