AZIZBEK KHABIBULLAEV
Git va Github bilan ishlash
Copyright © 2022 by Azizbek Khabibullaev
All rights reserved. No part of this publication may be
reproduced, stored or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording,
scanning, or otherwise without written permission from the
publisher. It is illegal to copy this book, post it to a website, or
distribute it by any other means without permission.
First edition
This book was professionally typeset on Reedsy.
Find out more at
reedsy.com
Contents
1
Git va GitHub bilan ishlash
1
1
Git va GitHub bilan ishlash
To’liq kurs videodarsligi:
https://youtu.be/GYmLXBlTqfE
— GIT
•
Git nima? - Version Control System (VCS) - Versiya
Boshqarish Tizimi
1.
index.html
2.
new-index.html
3.
new-rostan.index.html
4.
new-vapshe-rostan.index.html
•
Git afzalliklari:
•
kod versiyasini nazorat qilish;
•
qanday o’zgarishlar kiritilganligi haqida ma’lumot beradi
1
GIT VA GITHUB BILAN ISHLASH
•
o’zgartirish kiritilgan kodga kim tomonidan va qachon va aynan qaysi vaqtda kiritilganligi haqida ma’lumot beradi;
•
loyihalar bilan ishlashda individual yoki jamoaviy ishlash imkoniyatini yaratadi;
•
git for marketing/product management/designers/custom support/human resourses/…
•
Git va GitHub farqi
•
Git - local - Version Control System
•
GitHub - online - Version Control System Hosting Service (Xizmati)
•
Git dasturini o’rnatish
•
Windows uchun — Git Bash
•
MacOS uchun — Terminal, iTerm, Kitty
•
Git ni sozlab olish (nastroyka qilish)
•
git config …
— git ni sozlab olish uchun ishlatiladigan buyruq
•
git config - -list — barcha sozlamalarni ko’rsatish
•
git config user.name — git foydalanuvchisining ismi
•
git congif user.email — git foydalanuvchisining emaili
•
Agar bularning hech qaysi biri sozlanmagan bo’lsa va endig-
ina foydalanishni boshlagan bo’lsangiz. Unda uni sozlab
olamiz.
•
git config - -global user.name “username”
•
git config - -global user.email “email”
•
Gitda yangi loyiha yaratish (Git repository)
•
repository - ombor/loyiha
2
GIT VA GITHUB BILAN ISHLASH
•
git init — yangi git loyihani boshlash uchun ishlatiladi. Faqat 1 marta ishlating loyiha uchun.
•
git status
— o’zgarishga uchragan holatni tekshirish uchun
•
•
git add …
— loyihadagi yangi fayllar, o’zgarishlar va o’chirilishlarni xotiraga olish uchun navbatga qo’yiladi
•
git add faylnomi
•
git add .
•
•
git commit …
— navbatda turgan fayllarni butunlay saqlash uchun va xotiraga saqlanayotganda xabar bilan qoldirishimiz kerak.
•
git commit -m”xabaringiz”
•
•
git commit - -amend -m”xabaringiz” — navbatsiz butunlay saqlash
•
•
git log — shu paytgacha berilgan commitlar tarixi/ro’yhati
•
Fayl o’zgarishlarini bekor qilish
•
git checkout - - faylnomi
•
git checkout - - .
•
•
git checkout maxsuskod — loyihamizning xohlagan versiyasida sayr qilishimiz mumkin
•
git checkout master - ayni oxirgi ishlayotgan versiya
•
Git add dagi navbatni bekor qilish
•
git reset faylnomi
•
git reset .
3
GIT VA GITHUB BILAN ISHLASH
•
Branch/Merge
•
branch - filial
•
Branch yaratish:
•
git branch — hozirgi mavjud branchlar ro’yhati
•
git branch nom — yangi branch yaratish
•
git checkout nom — berilgan branchga o’tish
•
git merge branchnomi — berilgan branchni mavjud branchga yuklab olish
control panel > user accounts > credential manager > Windows
credentials > Generic credentials
Ijtimoiy tarmoqlarda:
Telegram:
@akh_blog
4
Document Outline
Dostları ilə paylaş: |