我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

Adding an existing project to GitHub using GitHub Desktop

You can add an existing Git repository to GitHub using GitHub Desktop.

  1. 使用命令行,删除当前为仓库配置的任何 Git 远程。

    # Show existing remotes
    $ git remote -v
    > origin  git@git-server/octocat/hello-world.git (fetch)
    > origin  git@git-server/octocat/hello-world.git (push)
    # Remove existing remotes
    $ git remote remove origin
  2. Add the repository to GitHub Desktop.

  3. 单击工具栏上的 Publish Repository(发布仓库)按钮。

    工具栏上的 Publish repository(发布仓库)按钮

  4. Type the desired name of the repository in the Name field or use the default current local repository name.

    The Name field

  5. To publish a public repository, unselect Keep this code private.

    Keep this code private checkbox

  6. Choose the organization in the Organization drop-down where you want to publish the repository, or select None to publish the repository to your personal account.

    Organization drop-down

  7. Click the Publish Repository button.

    The Publish repository button in the Publish Repository dialog

  1. 使用命令行,删除当前为仓库配置的任何 Git 远程。

    # Show existing remotes
    $ git remote -v
    > origin  git@git-server/octocat/hello-world.git (fetch)
    > origin  git@git-server/octocat/hello-world.git (push)
    # Remove existing remotes
    $ git remote remove origin
  2. Add the repository to GitHub Desktop.

  3. 单击工具栏上的 Publish Repository(发布仓库)按钮。

    工具栏上的 Publish repository(发布仓库)按钮

  4. Type the desired name of the repository in the Name field or use the default current local repository name.

    The Name field

  5. To publish a public repository, unselect Keep this code private.

    Keep this code private checkbox

  6. Choose the organization in the Organization drop-down where you want to publish the repository, or select None to publish the repository to your personal account.

    Organization drop-down

  7. Click the Publish repository button.

    The Publish repository button in the Publish repository dialog

问问别人

找不到要找的内容?

联系我们