---
name: "hub-init"
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-init"
---

# hub-init(1)

Initialize a git repository and add a remote pointing to GitHub.

## NAME

hub-init - Initialize a git repository and add a remote pointing to GitHub.

## SYNOPSIS

`hub init` -g

## OPTIONS

- \-g

  After initializing the repository locally, add the "origin" remote pointing to "*USER*/*REPO*" repository on GitHub.

  *USER* is your GitHub username, while *REPO* is the name of the current working directory.

## EXAMPLES

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

## SEE ALSO

[hub-create(1)](/hub-create/1.md), [hub(1)](/hub/1.md), [git-init(1)](/git-init/1.md)
