1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-02 14:53:57 +02:00

jj-git-*: add pages (#17143)

This commit is contained in:
Agam Agarwal 2025-07-09 08:38:55 +05:30 committed by GitHub
parent 8cd726d95f
commit 1228b2c838
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# jj git clone
> Create a new repo backed by a clone of a Git repo.
> Note: Unless `--colocate` is used, it is not a valid Git repository and `git` commands can't be used on it.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-clone>.
- Create a new repo backed by a clone of a Git repo into a new directory (the default directory is the repository name):
`jj git clone {{source}} {{path/to/directory}}`
- Create a clone and use the given name for newly created remote:
`jj git clone --remote {{remote_name}} {{source}}`
- Clone a Git repo, only fetching the 10 most recent commits:
`jj git clone --depth {{10}} {{source}}`
- Clone colocating the Jujutsu repo with the Git repo (allowing the use of both `jj` and `git` commands in the same directory):
`jj git clone --colocate {{source}}`

View file

@ -0,0 +1,20 @@
# jj git fetch
> Fetch from a Git remote, downloading objects and refs from the remote repository.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-fetch>.
- Fetch the latest changes from the default remote repository:
`jj git fetch`
- Fetch the latest changes from a given remote repository:
`jj git fetch --remote {{remote}}`
- Fetch the latest changes only from given branches:
`jj git fetch {{[-b|--branch]}} {{branch}}`
- Fetch the latest changes from all remotes:
`jj git fetch --all-remote`

View file

@ -0,0 +1,21 @@
# jj git init
> Create a new Git backed Jujutsu repo.
> Note: Unless `--colocate` is used, it is not a valid Git repository and `git` commands can't be used on it.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-init>.
- Create a new Git backed repo in the current directory:
`jj git init`
- Create a new Git backed repo in the given directory:
`jj git init {{path/to/directory}}`
- Initialize the Jujutsu repository as a valid Git repository (allowing the use of both `jj` and `git` commands in the same directory):
`jj git init --colocate`
- Initialize the Jujutsu repository backed by an existing Git repository:
`jj git init --git-repo {{git_repo}}`

View file

@ -0,0 +1,32 @@
# jj git push
> Push to a Git remote.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-push>.
- Push a bookmark to the given remote (defaults to `git.push` setting):
`jj git push {{[-b|--bookmark]}} {{bookmark}} --remote {{remote}}`
- Push a new bookmark:
`jj git push {{[-b|--bookmark]}} {{bookmark}} {{[-N|--allow-new]}}`
- Push all tracked bookmarks:
`jj git push --tracked`
- Push all bookmarks (including new bookmarks):
`jj git push --all`
- Push all bookmarks pointing to given revisions:
`jj git push {{[-r|--revisions]}} {{revset}}`
- Push changes/commits by creating new bookmarks (Name format is as per `templates.git_push_bookmark` setting, defaults to `"push-" ++ change_id.short()`):
`jj git push {{[-c|--change]}} {{revset}}`
- Push a revision with the given name:
`jj git push --named {{name}}={{revision}}`

View file

@ -0,0 +1,24 @@
# jj git remote
> Manage Git remotes.
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-git-remote>.
- List all Git remotes:
`jj git remote list`
- Add a Git remote:
`jj git remote add {{remote}} {{url}}`
- Change the URL of a Git remote:
`jj git remote set-url {{remote}} {{url}}`
- Remove a Git remote:
`jj git remote remove {{remote}}`
- Rename a Git remote:
`jj git remote rename {{old_name}} {{new_name}}`