gh(1)

NAME

gh-codespace-cp - Copy files between local and remote file systems

SYNOPSIS

gh codespace cp [-e] [-r] srcs... dest [flags]

DESCRIPTION

The cp command copies files between the local and remote file systems.

As with the UNIX cp command, the first argument specifies the source and the last specifies the destination; additional sources may be specified after the first, if the destination is a directory.

The -r (recursive) flag is required if any source is a directory.

A 'remote:' prefix on any file name argument indicates that it refers to the file system of the remote (Codespace) machine. It is resolved relative to the home directory of the remote user.

By default, remote file names are interpreted literally. With the -e flag, each such argument is treated in the manner of scp, as a Bash expression to be evaluated on the remote machine, subject to expansion of tildes, braces, globs, environment variables, and backticks, as in these examples:

$ gh codespace cp -e README.md 'remote:/workspace/$RepositoryName/'
 $ gh codespace cp -e 'remote:~/*.go' ./gofiles/
 $ gh codespace cp -e 'remote:/workspace/myproj/go.{mod,sum}' ./gofiles/

For security, do not use the -e flag with arguments provided by untrusted users; see https://lwn.net/Articles/835962/ for discussion.

OPTIONS

-c, --codespace=""
    Name of the codespace

-e, --expand[=false]
    Expand remote file names on remote shell

-r, --recursive[=false]
    Recursively copy directories

OPTIONS INHERITED FROM PARENT COMMANDS

--help[=false]
    Show help for command

SEE ALSO

gh-codespace(1)