Git Release Management
In this page:
git tag -a version_tag -m "release message"
git push remote_name version_tag
Tags से Software Releases बनाना
एक tag एक specific commit को एक named milestone की तरह mark करता है — सबसे common रूप से v1.0.0 जैसा एक release version — ताकि वह commit हमेशा ढूँढना और reference करना आसान रहे, चाहे यह originally किस branch से belong करती थी।
उदाहरण: Creating Software Releases with Tags
git tag v1.0.0
Annotated Tags बनाना
एक annotated tag (git tag -a v1.0.0 -m "message") Git के database में एक real object की तरह अपना author, date, और message store करता है, एक lightweight tag के उलट जो बस एक bare pointer है। एक official release के लिए, annotated form document करता है कि किसने और क्यों इसे cut किया, जो मायने रखता है जब कोई महीनों बाद release history audit कर रहा हो।
उदाहरण: Creating Annotated Tags
git tag -a v1.0.0 -m "First stable release"
Tags को Remote Server पर Push करना
Tags सिर्फ आपकी local repository में रहते हैं जब तक आप उन्हें push न करें — git push origin <tagname> एक भेजता है, git push --tags सबको एक साथ भेजता है। इस step को भूल जाना एक common surprise है: tag locally ठीक दिखता है लेकिन कोई और इसे नहीं देख सकता।
उदाहरण: Pushing Tags to the Remote Server
git push origin v1.0.0
git push --tags
Tags Delete करना
एक tag delete करने के लिए दो अलग commands चाहिए क्योंकि यह दो जगहों पर exist करता है: git tag -d <name> इसे locally हटाता है, और git push origin --delete <name> इसे remote से हटाता है — दूसरा skip करने का मतलब है यह अगली बार fetch करने वाले किसी के लिए भी फिर दिख जाता है।
उदाहरण: Deleting Tags
git tag -d v1.0.0
git push origin --delete v1.0.0
Tagged Releases Checkout करना
git checkout <tagname> आपकी working directory को उसी exact state में रखता है जिसमें यह उस release पर थी, जो किसी specific shipped version के against एक bug report reproduce करने या एक पुराना release exactly वैसे ही rebuild करने का standard तरीका है।
उदाहरण: Checking Out Tagged Releases
git checkout v1.0.0
- locally एक tag बनाना और यह मान लेना कि यह GitHub पर है, जबकि
git push origin v1.0.0याgit push --tagsचाहिए। - एक release के लिए एक lightweight tag इस्तेमाल करना, वह author, date और message miss करते हुए जो
git tag -arecord करता है। - एक version tag को एक अलग commit पर reuse करना, जबकि एक published tag को कभी move नहीं होना चाहिए और इसके बजाय एक नया version बनाया जाना चाहिए।
- Collaboration projects में contribute करने के लिए pull requests, code review, और forking पर depend करता है।
- Conflict resolution overlapping changes handle करता है।
- Commits squash करना और release management history और releases को organized रखते हैं।
Chapter Quiz — Complete all 6 topics to unlock
0/6 topics done
Complete these topics first: