Git First Repository
In this page:
mkdir project_folder
cd project_folder
git init
एक Git Repository क्या है?
एक Git repository बस एक normal folder plus एक hidden subfolder, .git, है, जहाँ Git actually पूरा tracking database store करता है -- हर commit, branch pointer, और history का piece उस एक directory के अंदर रहता है, everyday work के दौरान invisible।
उदाहरण: What is a Git Repository?
git init
ls -la
एक Project Folder बनाना
कुछ भी track करने से पहले, आपको काम करने के लिए एक clean folder चाहिए: mkdir my-project इसे बनाता है और cd my-project आपके terminal को इसके अंदर ले जाता है, Git को बिना किसी unrelated files के confuse किए एक empty starting point देते हुए।
उदाहरण: Creating a Project Folder
mkdir my-project
cd my-project
Folder में Git Initialize करना
उस folder के अंदर git init चलाना वह एक command है जो actually एक plain directory को एक Git repository में बदल देता है -- यह hidden .git database बनाता है और कुछ और नहीं, इसलिए आपकी मौजूदा files पूरी तरह untouched रहती हैं।
उदाहरण: Initializing Git in the Folder
git init
अपनी पहली File बनाना
tracking active होने पर, Git को actually track करने के लिए कुछ बनाएँ -- project explain करने वाली एक README.md, या एक simple HTML page -- क्योंकि एक empty repository के पास अभी commit करने के लिए कुछ meaningful नहीं है।
उदाहरण: Creating Your First File
echo "# My Project" > README.md
Hidden .git Folder Verify करना
ls -la चलाना (all के लिए extra -a ध्यान दें, जो hidden files reveal करता है) आपको confirm करने देता है कि .git folder really exist करता है; अगर यह missing है, git init या तो fail हुआ या गलत directory में चलाया गया।
उदाहरण: Verifying the Hidden .git Folder
ls -la
- गलत folder में
git initचलाना, जैसे आपकी home directory, ताकि Git इसके अंदर हर चीज़ track करने की कोशिश करे। - पहले से एक repository वाले folder के अंदर या किसी दूसरी repository के अंदर दोबारा
git initचलाना, एक nested.gitबनाते हुए। - hidden
.gitfolder को delete या edit करना, जो repository की पूरी history destroy कर देता है।
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: