InfoSphere/GitHub Desktop/ 返回书籍
Add & clone repositories

Add an existing project

qianmoQqianmoQ· 更新于 2026-09-16· 阅读 3 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Adding an existing project to GitHub using GitHub Desktop

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

  1. Using the command line, remove any git remotes currently configured for the repository.

    # 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. In the repository bar, click Publish repository.

    Screenshot of the repository bar. A button, labeled "Publish repository", is highlighted with an orange outline.

  4. In the "Publish Repository" window, in the "Name" field, type the desired name of the repository or use the default current local repository name.

  5. Optionally, add a description for the repository.

  6. Optionally, to publish a public repository, deselect Keep this code private.

  7. Select the "Organization" dropdown menu, then either click the organization where you want to publish the repository, or, to publish the repository to your personal account, click None.

  8. Click Publish Repository.

评论

登录后参与评论

正在加载评论…