1GH-REPO-FORK(1) GitHub CLI manual GH-REPO-FORK(1)
2
3
4
6 gh-repo-fork - Create a fork of a repository
7
8
9
11 gh repo fork [<repository>] [-- <gitflags>...] [flags]
12
13
14
16 Create a fork of a repository.
17
18
19 With no argument, creates a fork of the current repository. Otherwise,
20 forks the specified repository.
21
22
23 By default, the new fork is set to be your "origin" remote and any ex‐
24 isting origin remote is renamed to "upstream". To alter this behavior,
25 you can set a name for the new fork's remote with --remote-name.
26
27
28 The "upstream" remote will be set as the default remote repository.
29
30
31 Additional git clone flags can be passed after --.
32
33
34
36 --clone
37 Clone the fork
38
39
40 --default-branch-only
41 Only include the default branch in the fork
42
43
44 --fork-name <string>
45 Rename the forked repository
46
47
48 --org <string>
49 Create the fork in an organization
50
51
52 --remote
53 Add a git remote for the fork
54
55
56 --remote-name <string>
57 Specify the name for the new remote
58
59
60
62 gh-repo(1)
63
64
65
66 Nov 2023 GH-REPO-FORK(1)