Git And GitHub Collaborators and teams

   


        Git  And GitHub Collaborators and teams


๐Ÿ”ง 1. Version Control System: Git



➤ Git kya hai?

                    Git ek version control system hai jisse aap apne code ka pura record rakh sakte hain, aur multiple developers ek hi codebase pe parallel kaam kar sakte hain bina conflict ke.

๐ŸŒ 2. Remote Repository: GitHub / GitLab / Bitbucket

Ye platforms Git ka remote version rakhte hain jahan aapka project host hota hai aur sab developers access karte hain.


๐Ÿš€ Step-by-Step Setup (Multi-Developer Collaboration)

✅ Step 1: Git Install karo

check karo git version git --version

✅ Step 2: GitHub Account banao (ya GitLab / Bitbucket)


✅ Step 3: Local Git Setup

Run this command

Terminal ya Git Bash me run karo:

git config --global user.name "Rehan Khan"

git config --global user.email "rehan@example.com"


✅ Step 4: Project ko Git se connect karo

Agar project bana hua hai:

cd your-project-folder

git init

git remote add origin https://github.com/username/repo-name.git

git add .

git commit -m "Initial commit"

git push -u origin master  # ya main branch


✅ Step 5: Dusre Developer Clone karen:-



Dusra developer repo clone kare:- ab dusre develope ka VS CODE / Any Terminal open kijiye usme ye jo niche command hai usko paste kijiye

git clone https://github.com/username/repo-name.git

cd repo-name


๐Ÿง‘‍๐Ÿ’ป Another Developer:- Apna branch create karen

git switch -C feature/adding-marquee-effect (Branch ka name aap apne accourding likh sakte hai)

Check branch
git branch


* Apna Code Usi Branch me likhe

* Code complete hone par commit karen or push kar den

* GitHub pe push karne ke liye kuchh code hai

git add . (issse aapki sari file add ho jayegi)
git commit -m "some message"  (Isse aapki commit ho jayegi)
git push -u origin feature/adding-marquee-effect (ab aapka code github pe upload ho gya hai apna branch select karke aap dekh sakte hai )


* Merger Wala person fetch karega and merger karega:-

git fetch
git branch 
git switch feature/adding-marquee-effect
git switch main
git merge feature/adding-marquee-effect
git push origin main


*  Agar aap fetch or merger nhi karna chahte hai to ye command run karen:-

git switch main
git fetch
git pull 


* Notes:- pull = fetch + merger











Comments

Popular posts from this blog

How to create React JS application

๐ŸŽฏ Retrofit เคธे API Call เค•ैเคธे เค•เคฐें – Android Studio เคฎें (Java เค•े เคธाเคฅ Step-by-Step เค—ाเค‡เคก)