---
url: /en/guide/first-repo.md
---
An organization is a namespace for team member and resource management. Before creating repository resources, you need to create an organization to manage members and repositories.
Repositories can be used to host enterprise code assets and manage Cloud Native Build pipeline configurations.

## 1. Create an Organization

Click the `+` in the top right corner, select `Create Organization`, fill in the organization name and description, then click `Create` to complete the organization creation.

![Create Organization](/images/quick-start/create-group.en.png)

## 2. Create a Repository

Click the `+` in the top right corner, select `Create Repository`, choose the parent organization, fill in the repository name, and select the repository visibility as needed, then click `Create` to complete the repository creation.

![Create Repository](/images/quick-start/create-repo.en.png)

## 3. Initialize the Repository

You can choose any of the following methods to initialize the repository.

### 3.1 Cloud Quick Initialization (Recommended)

Work directly in the Cloud Native Development environment without local Git setup:

* **Migrate existing repository**: Paste the old repository URL on the welcome page for one-click migration
* **Create new files**: Create README and other files directly on the web

![Cloud Quick Initialization](/images/quick-start/workspace.en.png)

### 3.2 Push Local Project to CNB

If you already have a local project directory and want to push it to CNB:

```bash
# 1. Enter your local project directory
cd my-project

# 2. Initialize Git (if not already done)
git init

# 3. Add CNB repository as remote
git remote add origin https://cnb.share.ralphlauren.cn/org/repo-name.git

# 4. Add all files and commit
git add .
git commit -m "Initial commit"

# 5. Push to CNB (use -u for first push)
git push -u origin main
```

::: tip Note
If your local default branch is `master` instead of `main`, you can rename it with `git branch -M main`, or specify the branch name when pushing.
:::

### 3.3 Migrate from Other Platforms

#### Full Migration (Preserve All History)

```bash
# 1. Clone bare repository
git clone --bare https://github.com/old-repo.git

# 2. Push to CNB (--mirror syncs all branches and tags)
cd old-repo.git
git push --mirror https://cnb.share.ralphlauren.cn/org/new-repo.git

# 3. Clean up temporary files
cd .. && rm -rf old-repo.git
```

#### Migrate Specific Branches Only

```bash
# 1. Clone source repository
git clone https://github.com/old-repo.git
cd old-repo

# 2. Add CNB as remote
git remote add cnb https://cnb.share.ralphlauren.cn/org/new-repo.git

# 3. Push needed branches
git push cnb main
git push cnb develop

# 4. Push tags
git push cnb --tags
```

### 3.4 Clone Empty Repository and Commit

```bash
# 1. Clone the empty repository from CNB
git clone https://cnb.share.ralphlauren.cn/org/new-repo.git
cd new-repo

# 2. Create files
echo "# My Project" > README.md

# 3. Commit and push
git add README.md
git commit -m "Initial commit"
git push -u origin main
```
