Skip to content

Commit 662c229

Browse files
authored
Merge branch 'main' into repo-sync
2 parents fa811c9 + 42a3482 commit 662c229

3 files changed

Lines changed: 11 additions & 22 deletions

File tree

content/get-started/quickstart/create-a-repo.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,9 @@ Congratulations! You've successfully created your first repository, and initiali
6161
{% data reusables.cli.cli-learn-more %}
6262

6363
1. In the command line, navigate to the directory where you would like to create a local clone of your new project.
64-
2. To create a repository for your project, use the `gh repo create` subcommand. Replace `project-name` with the desired name for your repository. If you want your project to belong to an organization instead of to your user account, specify the organization name and project name with `organization-name/project-name`.
65-
66-
```shell
67-
gh repo create <em>project-name</em>
68-
```
69-
70-
3. Follow the interactive prompts. To clone the repository locally, confirm yes when asked if you would like to clone the remote project directory. Alternatively, you can specify arguments to skip these prompts. For more information about possible arguments, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_repo_create).
64+
2. To create a repository for your project, use the `gh repo create` subcommand. When prompted, select **Create a new repository on GitHub from scratch** and enter the name of your new project. If you want your project to belong to an organization instead of to your user account, specify the organization name and project name with `organization-name/project-name`.
65+
3. Follow the interactive prompts. To clone the repository locally, confirm yes when asked if you would like to clone the remote project directory.
66+
4. Alternatively, to skip the prompts supply the repository name and a visibility flag (`--public`, `--private`, or `--internal`). For example, `gh repo create project-name --public`. To clone the repository locally, pass the `--clone` flag. For more information about possible arguments, see the [GitHub CLI manual](https://cli.github.com/manual/gh_repo_create).
7167

7268
{% endcli %}
7369

content/github-cli/github-cli/creating-github-cli-extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ You can use the `gh extension create` command to create a project for your exten
7070

7171
```shell
7272
git init -b main
73-
gh repo create gh-<em>EXTENSION-NAME</em> --confirm
74-
git add . && git commit -m "initial commit" && git push --set-upstream origin main
73+
git add . && git commit -m "initial commit"
74+
gh repo create gh-<em>EXTENSION-NAME</em> --source=. --public --push
7575
```
7676

7777
1. Optionally, to help other users discover your extension, add the repository topic `gh-extension`. This will make the extension appear on the [`gh-extension` topic page](https://github.com/topics/gh-extension). For more information about how to add a repository topic, see "[Classifying your repository with topics](/github/administering-a-repository/managing-repository-settings/classifying-your-repository-with-topics)."

content/github/importing-your-projects-to-github/importing-source-code-to-github/adding-an-existing-project-to-github-using-the-command-line.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,17 @@ shortTitle: Add a project locally
3434
git init -b main
3535
```
3636

37-
1. To create a repository for your project on {% data variables.product.product_name %}, use the `gh repo create` subcommand. Replace `project-name` with the desired name for your repository. If you want your project to belong to an organization instead of to your user account, specify the organization name and project name with `organization-name/project-name`.
37+
1. Stage and commit all the files in your project
3838

3939
```shell
40-
gh repo create <em>project-name</em>
40+
git add . && git commit -m "initial commit"
4141
```
4242

43-
1. Follow the interactive prompts. Alternatively, you can specify arguments to skip these prompts. For more information about possible arguments, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_repo_create).
44-
1. Pull changes from the new repository that you created. (If you created a `.gitignore` or `LICENSE` file in the previous step, this will pull those changes to your local directory.)
43+
1. To create a repository for your project on GitHub, use the `gh repo create` subcommand. When prompted, select **Push an existing local repository to GitHub** and enter the desired name for your repository. If you want your project to belong to an organization instead of your user account, specify the organization name and project name with `organization-name/project-name`.
44+
45+
1. Follow the interactive prompts. To add the remote and push the repository, confirm yes when asked to add the remote and push the commits to the current branch.
4546

46-
```shell
47-
git pull --set-upstream origin main
48-
```
49-
50-
1. Stage, commit, and push all of the files in your project.
51-
52-
```shell
53-
git add . && git commit -m "initial commit" && git push
54-
```
47+
1. Alternatively, to skip all the prompts, supply the path to the repository with the `--source` flag and pass a visibility flag (`--public`, `--private`, or `--internal`). For example, `gh repo create --source=. --public`. Specify a remote with the `--remote` flag. To push your commits, pass the `--push` flag. For more information about possible arguments, see the [GitHub CLI manual](https://cli.github.com/manual/gh_repo_create).
5548

5649
## Adding a project to {% data variables.product.product_name %} without {% data variables.product.prodname_cli %}
5750

0 commit comments

Comments
 (0)