Tutorial Github: Anda harus mengetahui dasar-dasar ini
Dalam tutorial ini kami akan memperkenalkan Anda ke Github. Github adalah platform tempat Anda dapat mengelola, menyimpan, dan mengikuti proyek dan pengguna Git.
Github tutorial: apa itu git?
Sebelum Anda dapat memahami apa itu Github, Anda harus terlebih dahulu memahami konsep Git:
- Git adalah perangkat lunak manajemen versi untuk proyek. Anda cukup melompat kembali ke kios lama atau mengerjakan proyek dengan beberapa orang.
- Anda dapat menggunakan Git di baris perintah sistem operasi Anda atau di Github Desktop, klien Git dengan antarmuka pengguna grafis. Anda perlu mengetahui perintah berikut saat menggunakan Git:
- git clone [URL]: Mengkloning repositori Git dari URL ke komputer lokal Anda.
- git init: Inisialisasi proyek Git secara lokal. Anda dapat memuat ini secara opsional nanti di Github atau host lain.
- git add: Tambahkan file ke daftar tontonan. Langkah ini wajib untuk kemudian mengunggah pekerjaan Anda ke repositori.
- git commit: melakukan perubahan. Ini adalah gerai yang dapat Anda kunjungi kapan saja. Mengkomit file sebelum mereka dapat dikirim ke repositori jarak jauh.
- git push: Dengan push Anda mengirim semua commit ke repositori jarak jauh di server Github atau penyedia lain yang dipilih.
Tutorial: apa itu github?
Github adalah tuan rumah untuk proyek Git Anda dan memiliki properti yang mirip dengan jejaring sosial.
- Dengan Git Anda dapat mengakses proyek yang disimpan di Github dari mana saja.
- Repositori yang disimpan di Github selalu bersifat publik. Jadi pengguna lain dapat melihat proyek Anda. Repositori pribadi hanya tersedia dengan biaya bulanan.
- Anda juga dapat berkontribusi pada program yang ada dengan memperbaiki bug dan berpartisipasi aktif dalam perangkat sumber terbuka.
- Github sebagian besar digunakan untuk proyek yang luas dalam bahasa pemrograman tertentu. Namun, juga dimungkinkan untuk mengelola dokumen sederhana di Github.
Tutorial: Menyiapkan Git dan Github
Sebelum Anda bisa mulai dengan Git dan Github, Anda memerlukan akun Github dan harus menginstal Git secara lokal. Begini caranya:
- Pertama buat akun di Github. Ini cukup mudah dan dapat dilakukan dengan cepat dan mudah.
- Untuk menggunakan Github secara produktif, Anda sekarang membutuhkan Git di komputer lokal Anda.
- Sekarang instal Git. Pilih installer yang Anda butuhkan untuk sistem operasi Anda.
- Mulai Git Bash yang baru saja Anda instal pada Windows. Mulai terminal normal di macOS dan Linux.
- Dengan 'git config --global user.name "[Name]"' Anda sekarang harus mendefinisikan nama Anda.
- Seperti sebelumnya, gunakan 'git config --global user.email "[Mail]"' untuk menetapkan alamat email Anda. Gunakan email yang sama di sini yang Anda tentukan di Github.
Github Tutorial: Mengatur repositori
Jika Anda ingin memulai dengan proyek, Anda dapat membuat repositori dengan dua cara:
- Di Github, klik pada buku kecil di sebelah nama pengguna Anda untuk membuat repositori baru.
- Beri nama proyek Anda di sini. Seperti dijelaskan di atas, Anda perlu membuat proyek publik atau membayar biaya bulanan.
- Kemudian klik tombol hijau "Buat repositori". Anda kemudian dapat menambahkan repositori secara lokal menggunakan git clone seperti dijelaskan di atas.
- Buat repositori secara lokal dengan git init. Anda kemudian dapat menautkan repo lokal dan online dengan 'git remote add origin //github.com/[Username[/[Projektname[.git').
- Anda sekarang memiliki repositori online di Github sehingga Anda dapat mengelola proyek Anda dan menggunakannya dari mana saja.
Cara menggunakan markup untuk readme Anda di Github dapat dibaca di tip praktis berikutnya.