forked from jj-vcs/jj
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git: add --remote option to clone command
- Loading branch information
1 parent
5f84c73
commit 8c45f07
Showing
5 changed files
with
58 additions
and
7 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
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
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
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
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 |
---|---|---|
|
@@ -253,11 +253,22 @@ the [tutorial][tut]. | |
It is common to use several remotes when contributing to a shared repository. | ||
For example, "upstream" can designate the remote where the changes will be | ||
merged through a pull-request while "origin" is your private fork of the | ||
project. In this case, you might want to `jj git fetch` from "upstream" and to | ||
`jj git push` to "origin". | ||
project. | ||
|
||
You can configure the default remotes to fetch from and push to in your | ||
configuration file (for example `.jj/repo/config.toml`): | ||
```shell | ||
$ jj git clone --remote upstream https://github.com/upstream-org/repo | ||
$ cd repo | ||
$ jj git remote add origin [email protected]:your-org/your-repo-fork | ||
``` | ||
|
||
This will automatically setup your repository to track the main | ||
bookmark from the upstream repository, typically `main@upstream` | ||
or `master@upstream`. | ||
|
||
You might want to `jj git fetch` from "upstream" and to `jj git push` | ||
to "origin". You can configure the default remotes to fetch from and | ||
push to in your configuration file (for example | ||
`.jj/repo/config.toml`): | ||
|
||
```toml | ||
[git] | ||
|
@@ -266,3 +277,13 @@ push = "origin" | |
``` | ||
|
||
The default for both `git.fetch` and `git.push` is "origin". | ||
|
||
If you usually work on a project from several computers, you might | ||
want to fetch from both repositories to keep your own bookmarks | ||
synchronized: | ||
|
||
```toml | ||
[git] | ||
fetch = ["upstream", "origin"] | ||
push = "origin" | ||
``` |