---
name: "hub-remote"
section: "1"
platform: "linux"
package: "hub"
version: "2.14.2-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/hub-remote"
---

# hub-remote(1)

Add a git remote for a GitHub repository.

## NAME

hub-remote - Add a git remote for a GitHub repository.

## SYNOPSIS

`hub remote` add \[-p\] \[*OPTIONS*\] *USER*\[/*REPOSITORY*\]\
 `hub remote` set-url \[-p\] \[*OPTIONS*\] *NAME* *USER*\[/*REPOSITORY*\]

## OPTIONS

- \-p

  (Deprecated) Use the `ssh:` protocol instead of `git:` for the remote URL. The writeable `ssh:` protocol is automatically used for own repos, GitHub Enterprise remotes, and private or pushable repositories.

*USER*\[/*REPOSITORY*\]

If *USER* is "origin", that value will be substituted for your GitHub username. *REPOSITORY* defaults to the name of the current working directory.

## EXAMPLES

```
$ hub remote add jingweno
> git remote add jingweno git://github.com/jingweno/REPO.git
$ hub remote add origin
> git remote add origin git@github.com:USER/REPO.git
```

## SEE ALSO

[hub-fork(1)](/hub-fork/1.md), [hub(1)](/hub/1.md), [git-remote(1)](/git-remote/1.md)
