Skip to content

Commit

Permalink
Add useful alias to README
Browse files Browse the repository at this point in the history
  • Loading branch information
tkw1536 committed Jul 10, 2019
1 parent d9d91ee commit 465b99a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ ggman link $HOME/go/src/github.com/hello/world
would link the repository in `$HOME/go/src/github.com/hello/world` into the right location.
Here, this corresponds to `$GGROOT/github.com/hello/world`.

### Useful aliases

Sometimes, it is desireable to be able to cd into a specific directory.
For this purpose the following alias can be set up.
```bash
# ggcd allows 'cd'-ing into a directory given a repository name
# e.g ggcd github.com/hello/world will cd into the directory where the
# 'github.com/hello/world' repository is checked out.
ggcd () {
ggman -f $1 ls --exit-code && cd $(ggman -f $1 ls --exit-code 2>&1)
}
```

## getting `ggman`

To get `ggman` you have two options:
Expand Down

0 comments on commit 465b99a

Please sign in to comment.