Skip to content

Commit 854fb94

Browse files
committed
Improve docs and fix bug in workflow that missed the man page
1 parent 8770fea commit 854fb94

File tree

4 files changed

+71
-14
lines changed

4 files changed

+71
-14
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
LICENSE
2020
README.md
2121
git-get
22-
.get-get.1
22+
git-get.1

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,58 @@ git-get is an opinionated git command that helps you keep your code folder in or
44

55
git-get is a simple wrapper for `git clone` that clones your repository into a standard location so that you always know where your code is.
66

7-
git-get will place you inside your new folder when you're done because it saves typing `cd <the thing you just typed already>` :)
8-
97
## Installing
108

11-
All you get to do is to put `git-get` somewhere in your path :)
9+
Just put `git-get` somewhere in your path :)
10+
11+
## Usage
12+
13+
```
14+
git get [--print-path] <repository> [<args>]
15+
```
16+
17+
### Arguments
18+
19+
- `<repository>` - The repository URL to clone (required)
20+
- `[<args>]` - Additional arguments passed directly to `git clone`
21+
22+
### Options
23+
24+
- `--print-path` - Print the full path where the repository would be cloned and exit without cloning
25+
- `-h, --help` - Show help message and exit
1226

1327
## Examples
1428

29+
### Basic Usage
30+
1531
```shell
1632
git get https://github.com/stilvoid/git-get
17-
Cloning into '/home/steve/code/github.com/stilvoid/git-get'...
33+
Cloning into '/home/bob/code/github.com/stilvoid/git-get'...
34+
Successfully cloned to: /home/bob/code/github.com/stilvoid/git-get
1835
```
1936

2037
git-get uses the repository URL to figure out where to place your checked out copy.
2138

39+
### Supported URL Formats
40+
41+
git-get works with various repository URL formats:
42+
43+
```shell
44+
# HTTPS URLs
45+
git get https://github.com/stilvoid/git-get.git
46+
# → ~/code/github.com/stilvoid/git-get
47+
48+
# SSH URLs
49+
git get [email protected]:stilvoid/git-get.git
50+
# → ~/code/github.com/stilvoid/git-get
51+
52+
# Git protocol URLs
53+
git get git://github.com/stilvoid/git-get.git
54+
# → ~/code/github.com/stilvoid/git-get
55+
```
56+
57+
### Configuration
58+
2259
By default, git-get places all repositories under `~/code` but you can change that by setting get.location:
2360

2461
```shell

git-get

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ function print_help {
88
echo " git-get clones <repository> into a folder derived from the repository URL"
99
echo
1010
echo " For example, git get [email protected]:stilvoid/git-get.git"
11-
echo " will be checkout into ~/code/github.com/stilvoid/git-get.git"
11+
echo " will be cloned into ~/code/github.com/stilvoid/git-get"
1212
echo
1313
echo " You can override the default base path (~/code) with"
14-
echo " git config --global get.loation \"/path/to/your/code\""
14+
echo " git config --global get.location \"/path/to/your/code\""
1515
echo
16-
echo " --print-path will print out the full path that the repository would be clone into"
16+
echo " --print-path will print out the full path that the repository would be cloned into"
1717
echo " and then exits immediately without cloning"
1818
echo
19+
echo " -h, --help show this help message and exit"
20+
echo
1921
echo " Any other arguments are passed to the \"git clone\" command"
2022
}
2123

@@ -85,6 +87,9 @@ if [ "$COMMAND" == "print" ]; then
8587
exit
8688
fi
8789

90+
echo "Cloning into '$dir'..."
8891
CMD="git clone $GIT_ARGS -- \"$REPO\" \"$dir\""
8992

9093
eval "$CMD"
94+
95+
echo "Successfully cloned to: $dir"

git-get.1

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
.TH "GIT\-GET" "1" "2025-01-10" "https://github.com/stilvoid/git-get" "Git Manual"
22
.SH NAME
3-
git-git \- clone a git repository into a folder structure derived from the repository URL
3+
git-get \- clone a git repository into a folder structure derived from the repository URL
44
.SH SYNOPSIS
55
.B git-get
6+
[\fB\-h\fR | \fB\-\-help\fR | \fB\-\-print\-path\fR]
67
.IR repository
8+
[\fIargs\fR...]
79
.SH DESCRIPTION
810
.Nm
911
clones
1012
.IR repository
1113
into a folder derived from the repository URL by removing the scheme (e.g. \fIhttps://\fR),
1214
the username (e.g. \fIgit@\fR),
1315
and the suffix \fI.git\fR if it exists.
14-
.SH EXAMPLE
16+
.SH OPTIONS
17+
.TP
18+
.B \-\-print\-path
19+
Print the full path where the repository would be cloned and exit without cloning.
20+
.TP
21+
.B \-h, \-\-help
22+
Show help message and exit.
23+
.PP
24+
Any additional arguments are passed directly to the \fBgit clone\fR command.
25+
.SH CONFIGURATION
26+
You can override the default base path (\fI~/code\fR) with:
27+
.PP
28+
.RS
29+
$ git config --global get.location "/path/to/your/code"
30+
.RE
31+
.SH EXAMPLES
1532
.PP
1633
Clone the git-get repository:
1734
.PP
@@ -31,10 +48,8 @@ will both result in the repository being checked out to
3148
$HOME/code/github.com/stilvoid/git-get
3249
.RE
3350
.PP
34-
You can override the default base path (
35-
.I ~/code
36-
) with:
51+
Preview where a repository would be cloned:
3752
.PP
3853
.RS
39-
$ git config --global get.loation "/path/to/your/code"
54+
$ git get --print-path https://github.com/stilvoid/git-get.git
4055
.RE

0 commit comments

Comments
 (0)