1
0
mirror of synced 2025-12-22 03:16:52 -05:00

update gh repo create docs (#11932)

This commit is contained in:
Meijke
2021-11-17 13:07:34 -08:00
committed by GitHub
parent a9a4b899d3
commit 42a34821d5
3 changed files with 11 additions and 22 deletions

View File

@@ -34,24 +34,17 @@ shortTitle: Add a project locally
git init -b main
```
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`.
1. Stage and commit all the files in your project
```shell
gh repo create <em>project-name</em>
git add . && git commit -m "initial commit"
```
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).
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.)
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`.
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.
```shell
git pull --set-upstream origin main
```
1. Stage, commit, and push all of the files in your project.
```shell
git add . && git commit -m "initial commit" && git push
```
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).
## Adding a project to {% data variables.product.product_name %} without {% data variables.product.prodname_cli %}