readme: refactor Configuration section (#107)

This commit is contained in:
Paul Irish 2017-12-01 14:23:41 -08:00 committed by GitHub
parent b526edced1
commit cdfb1cb05c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,7 +103,9 @@ git-open can automatically guess the corresponding repository page for remotes
- Visual Studio Team Services
- Team Foundation Server (on-premises)
### Configuration (GitLab support)
## Configuration
### Configuring the web destination (aka GitLab support)
To configure GitLab support (or other unique hosting situations) you need to set some options.
@ -127,16 +129,20 @@ git config [--global] "open.https://git.internal.biz.domain" "repo.intranet/subp
git config [--global] "open.https://git.internal.biz.protocol" "http"
```
### Default remote
### Configuring which remote to open
Normally `git open` opens the remote named `origin`. When you fork a project
By default, `git open` opens the remote named `origin`. However, if your current branch is [remotely-tracking](https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches#_tracking_branches) a different remote, that tracked remote will be used.
In some instances, you may want to override this behavior. When you fork a project
and add a remote named `upstream` you often want that upstream to be opened
as the default remote. To accomplice this, you can do this:
rather than your fork. To accomplish this, you can set the `open.default.remote` within your project:
```sh
git config open.default.remote upstream
```
This is equivalent to always typing `git open upstream`.
## Alternative projects
See [hub](https://github.com/github/hub) for complete GitHub opening support.