1GH-CODESPACE-CP(1) GitHub CLI manual GH-CODESPACE-CP(1)
2
3
4
6 gh-codespace-cp - Copy files between local and remote file systems
7
8
9
11 gh codespace cp [-e] [-r] [-- [<scp flags>...]] <sources>... <dest>
12
13
14
16 The cp command copies files between the local and remote file systems.
17
18
19 As with the UNIX cp command, the first argument specifies the source
20 and the last specifies the destination; additional sources may be spec‐
21 ified after the first, if the destination is a directory.
22
23
24 The --recursive flag is required if any source is a directory.
25
26
27 A "remote:" prefix on any file name argument indicates that it refers
28 to the file system of the remote (Codespace) machine. It is resolved
29 relative to the home directory of the remote user.
30
31
32 By default, remote file names are interpreted literally. With the --ex‐
33 pand flag, each such argument is treated in the manner of scp, as a
34 Bash expression to be evaluated on the remote machine, subject to ex‐
35 pansion of tildes, braces, globs, environment variables, and backticks.
36 For security, do not use this flag with arguments provided by untrusted
37 users; see https://lwn.net/Articles/835962/ ⟨https://lwn.net/Arti‐
38 cles/835962/⟩ for discussion.
39
40
41
43 -c, --codespace <string>
44 Name of the codespace
45
46
47 -e, --expand
48 Expand remote file names on remote shell
49
50
51 -p, --profile <string>
52 Name of the SSH profile to use
53
54
55 -r, --recursive
56 Recursively copy directories
57
58
59
61 $ gh codespace cp -e README.md 'remote:/workspaces/$RepositoryName/'
62 $ gh codespace cp -e 'remote:~/*.go' ./gofiles/
63 $ gh codespace cp -e 'remote:/workspaces/myproj/go.{mod,sum}' ./gofiles/
64 $ gh codespace cp -e -- -F ~/.ssh/codespaces_config 'remote:~/*.go' ./gofiles/
65
66
67
68
69
71 gh-codespace(1)
72
73
74
75 Jun 2022 GH-CODESPACE-CP(1)