SOLFIND
Web Lens
Portal home

About remote repositories - GitHub Docs

https://docs.github.com/en/get-started/git-basics/about-remote-repositories • 196 KB fetched
Open original page


About remote repositories - GitHub Docs Skip to main content GitHub Docs Version: Free, Pro, & Team Search or ask Copilot Search or ask Copilot Select language: current language is English Search or ask Copilot Search or ask Copilot Open menu Collapse sidebar Expand sidebar Scroll breadcrumbs left * Home * Get started * Git basics * About remote repositories Scroll breadcrumbs right Get started * * * Start your journey * What is GitHub? * Learning resources * Create your repository * Plan your work * Connect locally * Write and store code * Review changes * Deploy automatically * Onboarding * Getting started with your GitHub account * Getting started with GitHub Team * Getting started with the GitHub Enterprise Cloud trial * Getting started with GitHub Enterprise Cloud * Using GitHub * Hello World * GitHub flow * Connecting to GitHub * Communicating on GitHub * Feature preview * Supported browsers * GitHub Mobile * Allow network access * Connectivity problems * Learning about GitHub * GitHub's plans * GitHub language support * Types of GitHub accounts * Access permissions * GitHub Advanced Security * Changes to GitHub plans * GitHub glossary * Learn to code * Set up Copilot for learning * Get started with Git * Finding example code * Reuse people's code * Local development * Debug with Copilot * Getting feedback on your code * Storing secrets safely * Secure your code * Secure your dependencies * Accessibility * Manage theme settings * Keyboard shortcuts * GitHub Command Palette * Writing on GitHub * Start writing on GitHub * Quickstart * About writing & formatting * Basic formatting syntax * Work with advanced formatting * Organized data with tables * Collapsed sections * Create code blocks * Create diagrams * Mathematical expressions * Auto linked references * Attaching files * About tasklists * Permanent links to code * Using keywords in issues and pull requests * Work with saved replies * About saved replies * Creating a saved reply * Editing a saved reply * Deleting a saved reply * Using saved replies * Share content with gists * Creating gists * Forking and cloning gists * Saving gists with stars * Moderating gist comments * Explore projects * Discover projects * Contribute to a project * Finding open source projects * Contribute to open source * Use Copilot to explore projects * Save repositories with stars * Following people * Following organizations * Git basics * Set up Git * Set your username * Caching credentials * Repeated credential prompts * macOS Keychain credentials * Git workflows * About remote repositories * Manage remote repositories * Associate text editors * Handle line endings * Ignoring files * Git cheatsheet * Using Git * About Git * Push commits to a remote * Get changes from a remote * Non-fast-forward error * Splitting a subfolder * About Git subtree merges * About Git rebase * Git rebase * Resolve conflicts after rebase * Special characters in names * Maximum push limit * Archive account and public repos * Request account archive * GitHub Archive program * Using GitHub Docs * Docs versions * Hover cards * GitHub Docs API * GitHub Certifications * About GitHub Certifications * Registering for an exam About remote repositories GitHub's collaborative approach to development depends on publishing commits from your local repository to GitHub for other people to view, fetch, and update. Copy as Markdown In this article * About remote repositories * Creating remote repositories * Choosing a URL for your remote repository * Cloning with HTTPS URLs * Cloning with SSH URLs * Cloning with GitHub CLI About remote repositories A remote URL is Git's fancy way of saying "the place where your code is stored." That URL could be your repository on GitHub, or another user's fork, or even on a completely different server. You can only push to two types of URL addresses: * An HTTPS URL like https://github.com/user/repo.git * An SSH URL, like [email protected]:user/repo.git Git associates a remote URL with a name, and your default remote is usually called origin . Creating remote repositories You can use the git remote add command to match a remote URL with a name. For example, you'd type the following in the command line: git remote add origin <REMOTE_URL> This associates the name origin with the REMOTE_URL . You can use the command git remote set-url to change a remote's URL . Choosing a URL for your remote repository There are several ways to clone repositories available on GitHub. When you view a repository while signed in to your account, the URLs you can use to clone the project onto your computer are available below the repository details. For information on setting or changing your remote URL, see Managing remote repositories . Cloning with HTTPS URLs The https:// clone URLs are available on all repositories, regardless of visibility. https:// clone URLs work even if you are behind a firewall or proxy. When you git clone , git fetch , git pull , or git push to a private remote repository using HTTPS URLs on the command line, Git will ask for your GitHub username and password. When Git prompts you for your password, enter your personal access token. Alternatively, you can use a credential helper like Git Credential Manager . Password-based authentication for Git has been removed in favor of more secure authentication methods. For more information, see Managing your personal access tokens . If you are accessing an organization that uses SAML SSO and you are using a personal access token (classic), you must also authorize your personal access token to access the organization before you authenticate. For more information, see About authentication with single sign-on and Authorizing a personal access token for use with single sign-on . Tip * You can use a credential helper so Git will remember your GitHub credentials every time it talks to GitHub. For more information, see Caching your GitHub credentials in Git . * To clone a repository without authenticating to GitHub on the command line, you can use GitHub Desktop to clone instead. For more information, see Cloning a repository from GitHub to GitHub Desktop . If you'd rather use SSH but cannot connect over port 22, you might be able to use SSH over the HTTPS port. For more information, see Using SSH over the HTTPS port . Cloning with SSH URLs SSH URLs provide access to a Git repository via SSH, a secure protocol. To use these URLs, you must generate an SSH keypair on your computer and add the public key to your account on GitHub. For more information, see Connecting to GitHub with SSH . When you git clone , git fetch , git pull , or git push to a remote repository using SSH URLs, you'll be prompted for a password and must provide your SSH key passphrase. For more information, see Working with SSH key passphrases . If you are accessing an organization that uses SAML single sign-on (SSO), you must authorize your SSH key to access the organization before you authenticate. For more information, see About authentication with single sign-on and Authorizing an SSH key for use with single sign-on " in the GitHub Enterprise Cloud documentation. Tip You can use an SSH URL to clone a repository to your computer, or as a secure way of deploying your code to production servers. You can also use SSH agent forwarding with your deploy script to avoid managing keys on the server. For more information, see Using SSH agent forwarding . Cloning with GitHub CLI You can also install GitHub CLI to use GitHub workflows in your terminal. For more information, see About GitHub CLI . Help and support Did you find what you needed? Yes No Privacy policy Help us make these docs great! All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request. Make a contribution Learn how to contribute Still need help? Ask the GitHub community Contact support Legal * © 2026 GitHub, Inc. * Terms * Privacy * Status * Pricing * Expert services * Blog

Links found on this page

  1. Skip to main content [direct]
  2. GitHub Docs [direct]
  3. Get started [direct]
  4. Git basics [direct]
  5. What is GitHub? [direct]
  6. Learning resources [direct]
  7. Create your repository [direct]
  8. Plan your work [direct]
  9. Connect locally [direct]
  10. Write and store code [direct]
  11. Review changes [direct]
  12. Deploy automatically [direct]
  13. Getting started with your GitHub account [direct]
  14. Getting started with GitHub Team [direct]
  15. Getting started with the GitHub Enterprise Cloud trial [direct]
  16. Getting started with GitHub Enterprise Cloud [direct]
  17. Hello World [direct]
  18. GitHub flow [direct]
  19. Connecting to GitHub [direct]
  20. Communicating on GitHub [direct]
  21. Feature preview [direct]
  22. Supported browsers [direct]
  23. GitHub Mobile [direct]
  24. Allow network access [direct]
  25. Connectivity problems [direct]
  26. GitHub's plans [direct]
  27. GitHub language support [direct]
  28. Types of GitHub accounts [direct]
  29. Access permissions [direct]
  30. GitHub Advanced Security [direct]
  31. Changes to GitHub plans [direct]
  32. GitHub glossary [direct]
  33. Set up Copilot for learning [direct]
  34. Get started with Git [direct]
  35. Finding example code [direct]
  36. Reuse people's code [direct]
  37. Local development [direct]
  38. Debug with Copilot [direct]
  39. Getting feedback on your code [direct]
  40. Storing secrets safely [direct]
  41. Secure your code [direct]
  42. Secure your dependencies [direct]
  43. Manage theme settings [direct]
  44. Keyboard shortcuts [direct]
  45. GitHub Command Palette [direct]
  46. Quickstart [direct]
  47. About writing & formatting [direct]
  48. Basic formatting syntax [direct]
  49. Organized data with tables [direct]
  50. Collapsed sections [direct]
  51. Create code blocks [direct]
  52. Create diagrams [direct]
  53. Mathematical expressions [direct]
  54. Auto linked references [direct]
  55. Attaching files [direct]
  56. About tasklists [direct]
  57. Permanent links to code [direct]
  58. Using keywords in issues and pull requests [direct]
  59. About saved replies [direct]
  60. Creating a saved reply [direct]
  61. Editing a saved reply [direct]
  62. Deleting a saved reply [direct]
  63. Using saved replies [direct]
  64. Creating gists [direct]
  65. Forking and cloning gists [direct]
  66. Saving gists with stars [direct]
  67. Moderating gist comments [direct]
  68. Discover projects [direct]
  69. Contribute to a project [direct]
  70. Finding open source projects [direct]
  71. Contribute to open source [direct]
  72. Use Copilot to explore projects [direct]
  73. Save repositories with stars [direct]
  74. Following people [direct]
  75. Following organizations [direct]
  76. Set up Git [direct]
  77. Set your username [direct]
  78. Caching credentials [direct]
  79. Repeated credential prompts [direct]
  80. macOS Keychain credentials [direct]