Skip to content

Commit cdfb1cb

Browse files
authored
readme: refactor Configuration section (paulirish#107)
1 parent b526edc commit cdfb1cb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ git-open can automatically guess the corresponding repository page for remotes
103103
- Visual Studio Team Services
104104
- Team Foundation Server (on-premises)
105105
106-
### Configuration (GitLab support)
106+
## Configuration
107+
108+
### Configuring the web destination (aka GitLab support)
107109
108110
To configure GitLab support (or other unique hosting situations) you need to set some options.
109111
@@ -127,16 +129,20 @@ git config [--global] "open.https://git.internal.biz.domain" "repo.intranet/subp
127129
git config [--global] "open.https://git.internal.biz.protocol" "http"
128130
```
129131
130-
### Default remote
132+
### Configuring which remote to open
133+
134+
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.
131135
132-
Normally `git open` opens the remote named `origin`. When you fork a project
136+
In some instances, you may want to override this behavior. When you fork a project
133137
and add a remote named `upstream` you often want that upstream to be opened
134-
as the default remote. To accomplice this, you can do this:
138+
rather than your fork. To accomplish this, you can set the `open.default.remote` within your project:
135139
136140
```sh
137141
git config open.default.remote upstream
138142
```
139143
144+
This is equivalent to always typing `git open upstream`.
145+
140146
## Alternative projects
141147
142148
See [hub](https://github.com/github/hub) for complete GitHub opening support.

0 commit comments

Comments
 (0)