-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update readme for (gitlab) config (#99)
- Loading branch information
Showing
2 changed files
with
15 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,27 +103,28 @@ git-open can automatically guess the corresponding repository page for remotes | |
- Visual Studio Team Services | ||
- Team Foundation Server (on-premises) | ||
### GitLab support | ||
### Configuration (GitLab support) | ||
To configure GitLab support you need to set some options. | ||
To configure GitLab support (or other unique hosting situations) you need to set some options. | ||
| option name | description | | ||
| ------------------------- | ---------------- | | ||
| open.[gitdomain].domain | The (web) domain to open based on the provided git repo domain | | ||
| open.[gitdomain].protocol | The (web) protocol to open based on the provided git repo domain. (Defaults to `https`) | | ||
| option name | description | example | | ||
| ------------------------- | ---------------------------------------------------------- | ------------------ | | ||
| gitopen.gitlab.domain | The (web)domain name that will work for most of the people | gitlab.example.com | | ||
| gitopen.gitlab.ssh.domain | A specific ssh domain name, *if needed* | git.example.com | | ||
| gitopen.gitlab.ssh.port | A specific ssh port, *if needed* | 10022 | | ||
```sh | ||
# use --global to set across all repos, instead of just the local one | ||
git config [--global] gitopen.gitlab.domain [value] | ||
git config [--global] gitopen.gitlab.ssh.domain [value] | ||
git config [--global] gitopen.gitlab.ssh.port [value] | ||
git config [--global] open.[gitdomain].domain [value] | ||
git config [--global] open.[gitdomain].protocol [value] | ||
``` | ||
If your Gitlab custom hosted is serving `http` you can also specify this: | ||
**Example** | ||
* Your git remote is at `ssh:https://[email protected]:7000/XXX/YYY.git` | ||
* Your hosted gitlab is `http:https://repo.intranet/subpath/XXX/YYY` | ||
```sh | ||
# use --global to set across all repos, instead of just the local one | ||
git config [--global] gitopen.gitlab.protocol http | ||
git config [--global] "open.https://git.internal.biz.domain" "repo.intranet/subpath" | ||
git config [--global] "open.https://git.internal.biz.protocol" "http" | ||
``` | ||
### Default remote | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,15 +276,13 @@ setup() { | |
@test "gitlab: default ssh origin style" { | ||
# https://github.com/paulirish/git-open/pull/55 | ||
git remote set-url origin "[email protected]:user/repo" | ||
git config "gitopen.gitlab.domain" "gitlab.example.com" | ||
run ../git-open | ||
assert_output "https://gitlab.example.com/user/repo" | ||
} | ||
|
||
@test "gitlab: ssh:https://git@ origin" { | ||
# https://github.com/paulirish/git-open/pull/51 | ||
git remote set-url origin "ssh:https://[email protected]/user/repo" | ||
git config "gitopen.gitlab.domain" "gitlab.domain.com" | ||
run ../git-open | ||
assert_output "https://gitlab.domain.com/user/repo" | ||
refute_output --partial "//user" | ||
|