How to add a Git remote
Today I had to add a remote to a Git repository after deleting the Git remote with git remote rm origin
, for reasons that I won’t bore you with.
Then I added a new Git remote to a GitHub repository with
git remote add origin git@github.com:flaviocopes/myrepo.git
Change flaviocopes/myrepo
to your GitHub URL.
Done!
→ Want to actually learn Git? Want to stop feeling frustrated with it? I created the
Git Masterclass
to solve this problem!
I wrote 21 books to help you become a better developer:
- HTML Handbook
- Next.js Pages Router Handbook
- Alpine.js Handbook
- HTMX Handbook
- TypeScript Handbook
- React Handbook
- SQL Handbook
- Git Cheat Sheet
- Laravel Handbook
- Express Handbook
- Swift Handbook
- Go Handbook
- PHP Handbook
- Python Handbook
- Linux Commands Handbook
- C Handbook
- JavaScript Handbook
- Svelte Handbook
- CSS Handbook
- Node.js Handbook
- Vue Handbook