← Back to Git Course | Chapter 7: Collaboration | Lesson 6 of 6

Git Release Management

Tags के साथ release management एक finished product box पर v1.0 जैसा एक version sticker लगाने जैसा है, ताकि कोई भी exactly ढूँढ सके कि क्या shipped हुआ।
Syntax
bash
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

bash
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

bash
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

bash
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

bash
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

bash
git checkout v1.0.0
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. locally एक tag बनाना और यह मान लेना कि यह GitHub पर है, जबकि git push origin v1.0.0 या git push --tags चाहिए।
  2. एक release के लिए एक lightweight tag इस्तेमाल करना, वह author, date और message miss करते हुए जो git tag -a record करता है।
  3. एक 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:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.