# Git Push a Newly Created Branch to a Remote Repository

> Use git push -u origin new-branch to create the branch on the remote repository and set the upstream tracking reference for future pushes and pulls

**URL:** https://sentry.io/answers/create-a-remote-branch-in-git/

---

## The Problem

How do I push a newly created branch in my local Git repository to a remote?

## The Solution

We can do this by adding the [`-u`/`--set-upstream`](https://git-scm.com/docs/git-push#Documentation/git-push.txt---set-upstream) flag to our [`git push`](https://git-scm.com/docs/git-push) command:

```bash
git push -u origin new-branch
```

This command will create a new branch named `new-branch` in the remote repository at `origin` and associate it with the `new-branch` branch in our local repository. This association means that any further commits added to the branch can be pushed with a simple `git push`.

---

*Source: [sentry.io/answers/create-a-remote-branch-in-git/](https://sentry.io/answers/create-a-remote-branch-in-git/)*
