BM: Baca dalam Bahasa Melayu
World 4: Hello GitHub
Remotes and origin
You will learn: how to tell Git where your GitHub repo lives.
The problem
Your empty diary repo on GitHub has a long web address. Must you type it on every push?
Pick one answer.
Watch
A remote / origin: A copy of your project on the internet, for example on GitHub. is a contact in Git’s address book. git remote add origin <url> saves GitHub as origin. git remote -v lists your contacts.
Try it
Build the command that saves your GitHub address as origin.
Tap the pieces in the right order.
Hint
Address book, add, name, address.Try it
Now type it in your diary. Then check with git remote -v.
Hint
Copy the address exactly, with.git at the end.Predict
Is the name origin special to Git?
Pick one answer.
Check
Tap the line Git uses when you push.
0 of 1 found
You did it!
You can now connect your project to a repo on GitHub.
Go deeper (optional)
Typo in the address? git remote set-url origin <new-url> fixes it. git remote rename and git remote remove exist too. Removing a remote only deletes the contact. The repo on GitHub stays.
Bahasa Melayu
Repo diary kosong anda di GitHub ada alamat web yang panjang. Perlukah anda taip setiap kali push?
Remote (salinan dalam talian) ialah kenalan dalam buku alamat Git. git remote add origin <url> simpan GitHub sebagai origin. git remote -v senaraikan kenalan anda.
Bina arahan yang simpan alamat GitHub anda sebagai origin.
Sekarang taip dalam diari anda. Kemudian semak dengan git remote -v.
.git di hujung.Adakah nama origin istimewa bagi Git?
Kini anda boleh sambungkan projek anda ke repo di GitHub.
You finished this before. Practice is always welcome!
Official docs: git remote · About remote repositories
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?