Skip to main content

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