Skip to content

Commit ae3a23c

Browse files
Move docker section further down in README.
1 parent 27be0ae commit ae3a23c

1 file changed

Lines changed: 45 additions & 42 deletions

File tree

README.md

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ $ brew install git-who
2828
#### Arch Linux
2929
[AUR Package](https://aur.archlinux.org/packages/git-who)
3030

31+
### Docker
32+
See the [section on Docker](#using-docker) below.
33+
3134
### From Source
3235
Building from source requires that you have Go, Ruby, and the `rake` Ruby gem
3336
installed. Note that these are _only_ required when building from source; you
@@ -555,48 +558,6 @@ the only one supported by `git who`.
555558

556559
You can disable caching by setting `GIT_WHO_DISABLE_CACHE=1`.
557560

558-
## Using `git-who` with Docker
559-
You can run `git-who` as a Docker container without installing it on your
560-
system directly. Follow these steps to build and use the Docker image.
561-
562-
### Building the Docker Image
563-
To build the `git-who` Docker image, run the following command from the project root:
564-
565-
```
566-
docker build -t git-who -f docker/Dockerfile .
567-
```
568-
569-
This will create a Docker image named `git-who` that you can use to run the tool.
570-
571-
### Running `git-who` via Docker
572-
To use git-who without modifying your Git configuration, you can manually run:
573-
574-
```
575-
docker run --rm -it -v "$(pwd)":/git -v "$HOME":/root git-who who
576-
```
577-
578-
- `--rm`: Automatically remove the container after execution.
579-
- `-it`: Enable interactive mode (for a better experience with CLI tools).
580-
- `-v "$(pwd):/git"`: Mounts the current Git repository into the container.
581-
- `-v "$HOME:/root"`: Ensures that user-specific configurations (e.g., SSH keys, Git settings) are available inside the container.
582-
583-
### Setting Up a Git Alias
584-
To make it easier to run `git-who`, you can add an alias to your Git
585-
configuration. Add the following lines to your `~/.gitconfig` file:
586-
587-
```
588-
[alias]
589-
who = !zsh -c "docker run --rm -it -v$(pwd):/git -v$HOME:/root git-who who $*"
590-
```
591-
592-
This allows you to run:
593-
594-
```
595-
git who
596-
```
597-
598-
from any Git repository, and it will invoke git-who through Docker.
599-
600561
## Git Alias
601562
If you install the `git-who` binary somewhere in your path, running `git who`
602563
will automatically invoke it with no further configuration. This is a Git
@@ -642,6 +603,48 @@ your Git configuration. If there is a file named `.git-blame-ignore-revs` at
642603
the root of your repository, `git who` will use it. Otherwise no commits will
643604
be skipped.
644605

606+
## Using Docker
607+
You can run `git-who` as a Docker container without installing it on your
608+
system directly. Follow these steps to build and use the Docker image.
609+
610+
### Building the Docker Image
611+
To build the `git-who` Docker image, run the following command from the project root:
612+
613+
```
614+
docker build -t git-who -f docker/Dockerfile .
615+
```
616+
617+
This will create a Docker image named `git-who` that you can use to run the tool.
618+
619+
### Running `git-who` via Docker
620+
To use git-who without modifying your Git configuration, you can manually run:
621+
622+
```
623+
docker run --rm -it -v "$(pwd)":/git -v "$HOME":/root git-who who
624+
```
625+
626+
- `--rm`: Automatically remove the container after execution.
627+
- `-it`: Enable interactive mode (for a better experience with CLI tools).
628+
- `-v "$(pwd):/git"`: Mounts the current Git repository into the container.
629+
- `-v "$HOME:/root"`: Ensures that user-specific configurations (e.g., SSH keys, Git settings) are available inside the container.
630+
631+
### Setting Up a Git Alias
632+
To make it easier to run `git-who`, you can add an alias to your Git
633+
configuration. Add the following lines to your `~/.gitconfig` file:
634+
635+
```
636+
[alias]
637+
who = !zsh -c "docker run --rm -it -v$(pwd):/git -v$HOME:/root git-who who $*"
638+
```
639+
640+
This allows you to run:
641+
642+
```
643+
git who
644+
```
645+
646+
from any Git repository, and it will invoke git-who through Docker.
647+
645648
## What Exactly Do These Numbers Mean?
646649
### Metrics
647650
The number of **commits** shown for each author is the number of unique commits

0 commit comments

Comments
 (0)