Tool.Yun
डेवलपर्स के लिए उपयोगी उपकरण
YAML को JSON में परिवर्तित करने वाला कनवर्टर
YAML को सुंदर बनाएं और प्रारूपित करें
YAML फ़्लैटनर/अनफ़्लैटनर
YAML विलय
YAML से TOML में रूपांतरण
HTML को मार्कडाउन में बदलना
Markdown को DOCX में बदलें
tools.markdown-format-converter.name
ईपब से मार्कडाउन
मार्कडाउन अंतर
मार्कडाउन के रूप में पेस्ट करें
मार्कडाउन को एचटीएमएल में बदलें
मार्कडाउन को टेक्स्ट में बदलें
मार्कडाउन टीओसी जनरेटर
मार्कडाउन टेबल जनरेटर
मार्कडाउन टेबल प्रेटिफायर
मार्कडाउन पूर्वावलोकन
मार्कडाउन लोरेम इप्सम
मार्कडाउन संपादक
मार्कडाउन से डेटा
EXIF हटाएं
GIF को MP4 में बदलें
ICO/PNG कनवर्टर
इमेज EXIF/मेटाडेटा/GPS/JPEG क्वालिटी रीडर
एचईआईसी कनवर्टर
एसवीजी पूर्वावलोकनकर्ता
कैमरा रिकॉर्डर
छवि आकार बदलने वाला
छवि और पीडीएफ का OCR परीक्षण करें
छवि की पृष्ठभूमि हटाएं
छवि को SVG में रूपांतरित करें (पोट्रेस)
छवि तुलना
छवि प्रारूप कनवर्टर
छवि रंग इन्वर्टर
छवि सुधारें # क्रॉप इमेज फोटो एडिटर
वाटर-मार्क
ObjGen से HTML
XML लिंटर
XML से JSON में रूपांतरण
XML स्वरूपक
XSLT परीक्षक
एक्सपाथ परीक्षक
Base64 फ़ाइल कनवर्टर
CSV से डेटा
dBm mW कनवर्टर
ईमेल नॉर्मलाइज़र
ऊर्जा खपत और व्यय कंप्यूटर
एक्सेल से डेटा
कई इकाइयों का कनवर्टर
टेक्स्ट को UTF-8 बाइनरी में रूपांतरित करें
टेक्स्ट को यूनिकोड में बदलें
टोरेंट से मैग्नेट तक
डेटा स्टोरेज यूनिट कनवर्टर
पर्यावरण चर प्रारूप कनवर्टर
पूर्णांक आधार कनवर्टर
प्रॉपर्टीज़ कनवर्टर
बेस64 स्ट्रिंग एनकोडर/डिकोडर
बेस64 हेक्स ऐरे एनकोडर/डिकोडर
भौगोलिक निर्देशांक कनवर्टर
यूएलआईडी जनरेटर
यूनिकोड वर्णों को जावा एंटिटी में परिवर्तित करने वाला
रोमन अंक परिवर्तक
Ansible vault crypt decrypt
Bech32 एनकोडर/डिकोडर
ECDSA कुंजी युग्म जनरेटर
Ed25519 कुंजी जोड़ी जनरेटर
RSA एन्क्रिप्शन
RSA कुंजी जोड़ी जनरेटर
RSA/DSA/ECDSA हस्ताक्षरकर्ता और सत्यापनकर्ता
SAML पार्सर
X509 प्रमाणपत्र जनरेटर
आर्गन2 हैशर
एचमैक जनरेटर
एजीई क्रिप्टोग्राफी
एसएसएल प्रमाणपत्र कनवर्टर
जेडब्ल्यूटी जनरेटर
जेडब्ल्यूटी पार्सर
जैसिप्ट स्ट्रिंग एन्क्रिप्शन
टेक्स्ट को एन्क्रिप्ट/डिक्रिप्ट करें
नाइसवेयर बाइट्स से पासफ़्रेज़ तक
पासेटो/पासेर्क लोकल
पासेटो/पासेर्क सार्वजनिक/निजी
पीजीपी एन्क्रिप्शन
पीजीपी कीजेन
पीजीपी फ़ाइल एन्क्रिप्शन
प्रमाणपत्र/कुंजी पार्सर
फ़ाइल हैशर
बीक्रिप्ट
शमीर के गुप्त रहस्यों का साझाकरण
सीआरसी कैलकुलेटर
सीएसआर जनरेटर
हैश टेक्स्ट
गणित ओसीआर
गणित प्रारूप कनवर्टर
गणित मूल्यांकनकर्ता
टिप कैलकुलेटर
त्रिकोणमितीय/समीकरण वक्र दृश्यक
बाइनरी कैलकुलेटर
क्रॉन एक्सप्रेशन बिल्डर
JSONPath सिंटैक्स चीटशीट
K8 चीटशीट
Nginx चीटशीट
Tmux कमांड चीटशीट
VIM चीटशीट
XPath सिंटैक्स चीटशीट
chmod कमांड चीटशीट
गिट चीटशीट
गिट सिमेंटिक कमिट चीटशीट
ज़ेलिज कमांड चीटशीट
जेक्यू चीटशीट
डॉकर कंपोज़ चीटशीट
डॉकर चीटशीट
डॉकर स्वार्म चीटशीट
डॉकरफ़ाइल चीटशीट
नैनो चीटशीट
पॉवरशेल चीटशीट
बैश चीटशीट
मार्कडाउन चीट शीट
रेगुलर एक्सप्रेशन चीटशीट
सामान्य रेगुलर एक्सप्रेशन चीटशीट
सीएसएस सिलेक्टर्स चीटशीट
सेड चीटशीट
स्क्रीन कमांड चीटशीट
कार्ड पिकर
पासा रोलर
भाग्य का पहिया
सिक्का पलटने वाला
CSV से JSON में रूपांतरण
JS से JSON कनवर्टर
JSON to Go
JSON अंतर
JSON आकार विश्लेषक
JSON एस्केपर/अनएस्केपर
JSON को .env फ़ाइल में बदलें
JSON को C# में रूपांतरित करना
JSON को CSV में बदलें
JSON को JS में परिवर्तित करने वाला कनवर्टर
JSON को PHP कोड में परिवर्तित करें
JSON को PHP-Array में बदलना
JSON को Python में परिवर्तित करें
JSON को YAML में परिवर्तित करने वाला कनवर्टर
JSON को ऑब्जेक्ट में परिवर्तित करें
JSON को सुंदर बनाना और प्रारूपित करना
JSON क्वेरी
JSON फ़्लैटनर/अनफ़्लैटनर
JSON मिनिफाई
JSON लिंटर
JSON विलय
JSON संपादक
JSON से MessagePack
JSON से SQL DDL
JSON से TOML
JSON से TS
JSON से XML में रूपांतरण
JSON से जावा एंटिटी
JSON से डेटा
JSON से स्कीमा
JSON सॉर्ट मास्टर
JSON स्ट्रिंग कनवर्टर
Jq/JSONPath परीक्षक
ObjGen को JSON में परिवर्तित करें
PHP-Array को JSON में परिवर्तित करना
tools.json-patch.name
संदेश पैक को JSON में बदलें
BIP39 पासफ़्रेज़ जनरेटर
UUID कनवर्टर
UUID जनरेटर
ओटीपी कोड जनरेटर
टोकन जनरेटर
डाइसवेयर पासवर्ड जनरेटर
नैनोआईडी जनरेटर
पासफ़्रेज़ जनरेटर
पिन कोड जनरेटर
यादृच्छिक संख्या जनरेटर
संख्यावाचक नाम जनरेटर
TOML से JSON में रूपांतरण
TOML से YAML
टीओएमएल लिंटर
Docker Compose को .env फ़ाइल में स्थानांतरित करें
कुबेरनेट्स आरबीएसी जनरेटर
ट्रैफ़िक डॉकर कंपोज़ मेकर
डॉकर इंस्पेक्ट से डॉकर रन तक
डॉकर इमेज डाउनलोडर
डॉकर कंपोज़ को डॉकर रन में परिवर्तित करें
डॉकर कंपोज़ फॉर्मेट कनवर्टर
डॉकर कंपोज़ वैलिडेटर
डॉकर कंपोज़ से कुबेरनेट्स तक
डॉकर कंपोज़ से क्वाडलेट्स तक
डॉकर को कुबेरनेट्स पर चलाएं
डॉकर क्वाडलेट्स पर चलता है
डॉकर पैंगोलिन लेबल
डॉकर रन को डॉकर कंपोज़ में परिवर्तित करें
डॉकरफ़ाइल लेबल जनरेटर
ISBN वैलिडेटर और पार्सर
आईईएस प्रकाश दिशानिर्देश
आईएसओ 3166 देश कोड खोजक
आईएसओ 639 खोजकर्ता
आईबैन वैलिडेटर और पार्सर
आरएमबी अपरकेस कनवर्टर
एसएलए कैलकुलेटर
ऑनलाइन शब्दकोश
कैलेंडर कनवर्टर
क्रेडिट कार्ड चेकर
दौड़ने की गति कैलकुलेटर
फ़ोन पार्सर और फ़ॉर्मेटर
बीएमआई कैलकुलेटर
मुद्रा परिवर्तक
यूनिकोड खोज
लुह्न वैलिडेटर
वैट नंबर सत्यापनकर्ता
शेल कमांड की व्याख्या करें
सॉफ़्टवेयर लाइसेंस संगतता
ETA कैलकुलेटर
अवधि कैलकुलेटर
आईकैल विलय
आईसीएएल जनरेटर
आईसीएएल फ़ाइल पार्सर
उलटी गिनती
क्रॉन/सप्ताह के दिन का अलार्म
जिस दिन?
टाइमज़ोन कनवर्टर
टीटीएल कैलकुलेटर
ठीक घड़ी
दिनांक+अवधि कैलकुलेटर
दिनांक-समय परिवर्तक
दिनों की गणना
सप्ताह संख्या परिवर्तक
समय अलार्म
BIMI DNS जनरेटर
Chmod कैलकुलेटर
DMARC DNS जनरेटर
DNS क्वेरीज़
DNSBL चेकर
Htpasswd/htaccess जनरेटर
IPRange/CIDR/IPMask में IPv4-6/IPRange/CIDR
IPv4 पता कनवर्टर
IPv4 रेंज विस्तारक
IPv4 सबनेट कैलकुलेटर
IPv4/6 रेंज को CIDR में बदलने वाला कैलकुलेटर
IPv6 ULA जनरेटर
MAC एड्रेस लुकअप
RAID कैलकुलेटर
RAID विश्वसनीयता कैलकुलेटर
Rsync जनरेटर
Whois चेकर
X-VR-स्पैमकॉज़ डिकोडर
ZPOOL RAID कैलकुलेटर
ZPool चीटशीट
Zxcvbn पासवर्ड की मजबूती
tools.restic-command-generator.name
tools.url-redirection-checker.name
अपाचे लॉगरोटेट जनरेटर
आईपी जियो लोकेशन
आईपी सबनेट एक्सक्लूड कैलकुलेटर
आईपीटेबल्स जनरेटर
आईपीवी4 सबनेट सूची
आईपीवी4/6 सीआईडीआर से आईपी रेंज कैलकुलेटर
आईपीवी6 एड्रेस कनवर्टर
आईपीवी6 सबनेट कैलकुलेटर
एआरपीए डिकोडर
एचएएस सैनिटाइजर
एचटीएसेस जनरेटर
एचडीडी कैलकुलेटर
एनजिनक्स फॉर्मेटर
एफस्टैब जनरेटर
एसआईपी प्राधिकरण
एसपीएफ डीएनएस जनरेटर
कर्ल कमांड जनरेटर
क्रोनटैब जनरेटर
क्लाउडफ्लेयर DNS/RDAP क्वेरीज़
गुनगुनाहट
टीसीपी/यूडीपी पोर्ट परीक्षक
डब्ल्यूपीए पीएसके जनरेटर
डीकेआईएम डीएनएस जनरेटर
डेटा स्थानांतरण दर कैलकुलेटर
पासवर्ड शक्ति विश्लेषक
पीटीआर डीएनएस जनरेटर
पुनीकोड कनवर्टर
पूर्णांकों को IPv4/IPv6 में परिवर्तित करना
फायरवॉलडी कमांड लाइन जनरेटर
बंदरगाह संख्याएँ
बुनियादी प्रमाणीकरण जनरेटर
मल्टी लिंक डाउनलोडर
माइक्रोफ़ोन परीक्षक
मेरा आईपी पता
मैक एड्रेस कनवर्टर
मैक एड्रेस जनरेटर
यूएफडब्ल्यू कमांड जनरेटर
रैंडम पोर्ट जनरेटर
वायरगार्ड कॉन्फ़िगरेशन जनरेटर
विकल्प 43 जनरेटर
विज़ुअल सबनेट कैलकुलेटर
वेबसॉकेट परीक्षण
शटडाउन कमांड जनरेटर
शेल कमांड फॉर्मेटर
शेल कमांड्स लीनियराइज़र
HTML से PDF में रूपांतरण
पीडीएफ एन्क्रिप्ट
पीडीएफ कंप्रेसर
पीडीएफ को डिक्रिप्ट और अनलॉक करें
पीडीएफ टेक्स्ट एक्सट्रैक्टर
पीडीएफ पेज एक्सट्रैक्टर
पीडीएफ लीनियराइज़/फास्टवेब
पीडीएफ संयोजनकर्ता
पीडीएफ हस्ताक्षर परीक्षक
GZip/डिफ्लेट कनवर्टर
HTTPS परीक्षक
MongoDB ऑब्जेक्ट आईडी कनवर्टर
RJ45 Cat6 वायरिंग चीटशीट
आउटलुक एमएसजी पार्सर
आउटलुक सेफलिंक डिकोडर
ईएमवी टीएलवी डिकोडर
ईटीएच लेनदेन डिकोडर
ईमेल पार्सर
एक्टिवडायरेक्टरी एलडीएपी प्रॉपर्टीज सर्चर
एनमैप कमांड बिल्डर
एमआईएम एन्कोडिंग कनवर्टर
कुंजीकोड जानकारी
कुकी पार्सर
टीसीपीडींप जनरेटर
टेक्स्ट कैरेक्टर सेट डिटेक्टर/डिकोडर
डीएनएस परीक्षक
डीएनएस प्रसार परीक्षक
डीएमएआरसी रिपोर्ट विश्लेषक
डेड पिक्सेल परीक्षक
पार्केट फाइल रीडर
प्रतिरोधक कैलकुलेटर
फ़ाइल प्रकार डिटेक्टर
फ्लोटिंग पॉइंट संख्या कनवर्टर
बाउंस ईमेल पार्सर
मध्य-एंडियन कनवर्टर
यूआरएल पार्सर
यूआरएल बिल्डर
लघु यूआरएल विस्तारक
शेयरपॉइंट शेयर यूआरएल डिकोडर
संवेदनशील डेटा मास्कर
सीरियल पोर्ट कंसोल
स्नोफ्लेक आईडी एक्सट्रैक्टर
स्मार्ट रॉ कनवर्टर
हेक्स एनकोडर/डिकोडर
键盘测试器
GTIN वैलिडेटर
tools.epc-qrcode-generator.name
क्यूआर कोड जनरेटर
क्यूआर कोड डिकोडर
क्यूआर संपर्क जानकारी जनरेटर
बारकोड जनरेटर
बारकोड रीडर
वाईफाई क्यूआर कोड जनरेटर
आयतन प्रवाह दर कनवर्टर
ऊर्जा इकाई परिवर्तक
एसआई उपसर्ग कनवर्टर
कोण इकाई कनवर्टर
क्षेत्रफल इकाई परिवर्तक
खाद्य ऊर्जा परिवर्तक
तापमान परिवर्तक
त्वरण कनवर्टर
दबाव इकाई कनवर्टर
द्रव्यमान इकाई परिवर्तक
पावर कनवर्टर
प्रकाश कनवर्टर
फिटनेस कंप्यूटर
फ्रिक्वेंसी परिवर्तक
बल इकाई परिवर्तक
लंबाई इकाई परिवर्तक
वॉल्यूम यूनिट कनवर्टर
स्पीड कन्वर्टर
आस्पेक्ट रेशियो कैलकुलेटर
प्रतिशत कैलकुलेटर
बेंचमार्क निर्माता
भौगोलिक दूरी कैलकुलेटर
JSON से TOON
TOON से JSON
Tab बटन दबाकर Spaces पर जाएं
आरएसवीपी रीडर
इमोजी चयनकर्ता
उद्धरण जनरेटर
एआई के लिए पैक फ़ाइलें
एआई प्रॉम्प्ट स्प्लिटर
एएससीआईआई आर्ट टेक्स्ट जनरेटर
एचटीएमएल से टेक्स्ट निकालें
कीबोर्ड लेआउट कनवर्टर
केस कनवर्टर
छवि को ASCII आर्ट में रूपांतरित करें
ज़ाल्गो जनरेटर/बैनर
जीपीटी टोकन अनुमानक
जीपीटी टोकन एनकोडर/डिकोडर
टेक्स्ट को यूनिकोड नामों में बदलना
डुप्लिकेट लाइन खोजक
नमस्कार, जनरेटर।
नाटो वर्णमाला में पाठ
पाठ अंतर
पाठ अनुवादक
पाठ सांख्यिकी
फ़ॉन्ट तुलना
फ़ोल्डर संरचना आरेख
मत्स्यांगना निर्यातक
मैं और एल चेकर
मोर्स कोड कनवर्टर
यूनिकोड से जीएसएम-7
यूनिकोड स्वरूपक
रूण कनवर्टर
रेगुलर एक्सप्रेशन टेस्टर
रैंडम लाइन पिकर
लेवेनस्टीन कैलकुलेटर
विशिष्ट शब्द
सूचियों की तुलना करें
सूची कनवर्टर
सेड कमांड जनरेटर
सोशल लिंक शेयरर
स्ट्रिंग ऑबफस्केटर
स्मार्ट टेक्स्ट रिप्लेसर और लाइनब्रेकर
CLI कमांड संपादक
CSS/JS प्रेटिफ़ाई और मिनिमाइज़
Django सीक्रेट जेनरेटर
JSON को TypeScript में परिवर्तित करें
JSON से Protobuf में रूपांतरण
JSON से SQL में डेटा आयात करें
K6 लोड टेस्टिंग स्क्रिप्ट जनरेटर
SQL को सुंदर बनाना और प्रारूपित करना
SQL पैरामीटर जनरेटर
SQL मिनिफायर
उद्धरण कनवर्टर
एएनएसआई एस्केप टेस्टर
एपीआई परीक्षण
ओपन ग्राफ़ मेटा जनरेटर
कर्ल कनवर्टर
कोड/स्क्रिप्ट हाइलाइटर
गिट एट्रिब्यूट्स जेनरेटर
गिटइग्नोर जनरेटर
जावास्क्रिप्ट अनऑबफस्केटर/अनपैकर
जावास्क्रिप्ट ऑबफस्केटर
जावास्क्रिप्ट प्रेटिफायर
डेटा जालसाज़
डेटाबेस कनेक्शन स्ट्रिंग बिल्डर
डेटाबेस टेबल जनरेटर
डेटाबेस निर्माण बिल्डर
पिकोमैच परीक्षक
पोमोडोरो टाइमर
फ़ाइल स्प्लिटर
फेविकॉन जनरेटर
मेलटो जनरेटर
स्टैकट्रेस और भी सुंदर
स्ट्रिंग एस्केपर
स्वैगर यूआई परीक्षक
हेक्स फ़ाइल कनवर्टर
परिशोधन कैलकुलेटर
HTML एंटिटी से बाहर निकलें
HTML क्लीनर
HTML मिनिफायर
HTML से XHTML
HTML से डेटा
HTTP स्थिति कोड
REM पिक्सेल कनवर्टर
SVG प्लेसहोल्डर जनरेटर
उपयोगकर्ता-एजेंट पार्सर
एचटीएमएल डब्ल्यूवाईएसआईडब्ल्यूवाईजी संपादक
एचटीएमएल प्रेटिफायर
एमआईएम प्रकार
छवि को सीएसएस में बदलें
डिवाइस की जानकारी
यूआरएल कैचर
यूआरएल क्लीनर
यूआरएल टेक्स्ट सर्च फ़्रैगमेंट मेकर
यूआरएल स्वरूपित स्ट्रिंग को एन्कोड/डिकोड करें
यूटीएम यूआरएल जनरेटर
रंग कंट्रास्ट चेकर
रंग कनवर्टर
रंग पहिया
सीएसएस एक्सपाथ कनवर्टर
सीएसएस ग्रेडिएंट जनरेटर
सीएसएस प्रेटिफायर
सीएसएस यूनिट्स कन्वर्टर
स्लगिफ़ाई स्ट्रिंग

गिट चीटशीट

Git एक विकेन्द्रीकृत संस्करण प्रबंधन सॉफ़्टवेयर है। इस चीटशीट की मदद से आप सबसे आम Git कमांड्स तक आसानी से पहुँच सकते हैं।

Git is a distributed version control system: every clone is a full repository with its own history, branches and tags. This is a quick reference for the commands that come up daily — placeholders are written as <file>, <branch>, <commit> and <url>.

💡 Every command below has its own help (git rebase --help), and the destructive ones (clean, push, rm, mv) take -n / --dry-run to preview what would happen.

⚙️ Configuration

# identity used on every commit
git config --global user.name "<name>"
git config --global user.email "<email>"

# name of the branch created by git init
git config --global init.defaultBranch main

# editor for messages, rebases, ...
git config --global core.editor "code --wait"

# rebase instead of merging on pull
git config --global pull.rebase true

# plain 'git push' works on new branches
git config --global push.autoSetupRemote true

# every setting and the file it came from
git config --list --show-origin

# override for this repository only
git config --local user.email "<work-email>"

Handy aliases:

git config --global alias.st status

git config --global alias.co checkout

git config --global alias.lg "log --oneline --graph --decorate --all"

git config --global alias.last "log -1 --stat"

🚀 Get Started

# create a repository in the current directory
git init

# clone a remote repository
git clone <url>

# clone into a specific directory
git clone <url> <directory>

# clone and check out one branch
git clone --branch <branch> <url>

# shallow clone, latest commit only
git clone --depth 1 <url>

# clone including submodules
git clone --recurse-submodules <url>

# what is staged, changed, untracked
git status

# the same, in short format
git status -sb

➕ Staging

# stage a specific file
git add <file>

# stage everything under the current directory
git add .

# stage everything in the repository, deletions included
git add -A

# interactively stage individual hunks
git add -p <file>

# stage modifications and deletions, not new files
git add -u

# unstage, keep the changes in the working tree
git restore --staged <file>

# stop tracking a file, keep it on disk
git rm --cached <file>

# rename and stage in one step
git mv <old> <new>

# which .gitignore rule is hiding this file?
git check-ignore -v <file>

✅ Commit

# commit what is staged
git commit -m "<message>"

# stage tracked changes and commit
git commit -am "<message>"

# rewrite the last commit (message + content)
git commit --amend

# amend without changing the message
git commit --amend --no-edit

# fixup commit, squashed later by --autosquash
git commit --fixup <commit>

# add a Signed-off-by trailer
git commit -s -m "<message>"

# empty commit, e.g. to trigger CI
git commit --allow-empty -m "<message>"

⚠️ --amend rewrites history. Only amend commits that have not been pushed to a shared branch.

🌿 Branches

# list local branches
git branch

# local and remote-tracking branches
git branch -a

# last commit and upstream of each branch
git branch -vv

# switch to an existing branch
git switch <branch>

# create a branch and switch to it
git switch -c <branch>

# jump back to the previous branch
git switch -

# older equivalent of switch -c
git checkout -b <branch>

# branch off a specific commit or tag
git switch -c <branch> <commit>

# rename a branch
git branch -m <old> <new>

# delete a merged branch
git branch -d <branch>

# force-delete an unmerged branch
git branch -D <branch>

# branches already merged into HEAD (safe to delete)
git branch --merged

🔀 Merging & Rebasing

# merge a branch into the current one
git merge <branch>

# always create a merge commit
git merge --no-ff <branch>

# bring in the changes as one staged change set
git merge --squash <branch>

# bail out of a conflicted merge
git merge --abort

# replay the current branch on top of another
git rebase <branch>

# interactively squash, reword, drop, reorder commits
git rebase -i HEAD~5

# apply the --fixup commits automatically
git rebase -i --autosquash <base>

# resume after resolving conflicts
git rebase --continue

# drop the conflicting commit and continue
git rebase --skip

# return to the state before the rebase
git rebase --abort

# resolve conflicts with the configured merge tool
git mergetool

Resolving a conflict:

# 1. see which files conflict
git status

# 2. edit them and remove the <<<<<<< ======= >>>>>>> markers

# 3. mark each resolved file
git add <file>

# 4. resume (during a merge: git merge --continue)
git rebase --continue

⚠️ Rebasing rewrites commits. Never rebase a branch other people are already working on.

🌍 Remotes & Syncing

# list remotes and their URLs
git remote -v

# add a remote
git remote add origin <url>

# point a remote somewhere else
git remote set-url origin <url>

# rename a remote
git remote rename <old> <new>

# forget a remote
git remote remove <name>

# download objects and refs, change nothing
git fetch origin

# fetch everything, drop deleted remote branches
git fetch --all --prune

# fetch + merge (or rebase) the upstream branch
git pull

# replay local commits on top of the upstream
git pull --rebase

# push the current branch
git push

# push and set the upstream tracking branch
git push -u origin <branch>

# force-push, but refuse to clobber new commits
git push --force-with-lease

# delete a remote branch
git push origin --delete <branch>

# push all tags
git push origin --tags

⚠️ Prefer --force-with-lease over --force: it aborts if someone else pushed in the meantime.

📦 Stashing

# shelve tracked changes and clean the working tree
git stash

# include untracked files
git stash -u

# stash specific paths with a label
git stash push -m "<message>" <file>

# list every stash
git stash list

# show a stash as a patch
git stash show -p stash@{0}

# re-apply the newest stash and drop it
git stash pop

# re-apply a specific stash, keep it in the list
git stash apply stash@{2}

# create a branch from a stash and apply it
git stash branch <branch>

# delete one stash
git stash drop stash@{0}

# delete all stashes
git stash clear

🔍 Inspecting

# the whole history as a compact graph
git log --oneline --graph --decorate --all

# history of a file, with diffs
git log -p <file>

# history of a file, following renames
git log --follow <file>

# filter by date and author
git log --since="2 weeks ago" --author=<name>

# search commit messages
git log --grep="<pattern>"

# commits that added or removed a string
git log -S"<string>"

# commits in b that are not in a
git log <branch-a>..<branch-b>

# commit count per author
git shortlog -sn

# a single commit with its diff
git show <commit>

# working tree vs. index
git diff

# index vs. last commit
git diff --staged

# between two commits
git diff HEAD~1 HEAD

# changes since the branches diverged
git diff <branch-a>...<branch-b>

# summary of changed files
git diff --stat

# who last touched every line
git blame <file>

# blame a range of lines only
git blame -L 10,40 <file>

# search the tracked files
git grep "<pattern>"

# every position HEAD has had — your safety net
git reflog

🍒 Cherry-pick

# apply one commit onto the current branch
git cherry-pick <commit>

# apply a range of commits
git cherry-pick <commit-a>^..<commit-b>

# apply without committing
git cherry-pick -n <commit>

# after resolving conflicts
git cherry-pick --continue

# undo the whole cherry-pick
git cherry-pick --abort

🏷 Tags

# list tags
git tag

# list matching tags
git tag -l "v1.*"

# annotated tag on HEAD
git tag -a v1.0.0 -m "Release v1.0.0"

# tag an older commit
git tag -a v1.0.0 <commit>

# show a tag and its commit
git show v1.0.0

# push one tag
git push origin v1.0.0

# push all tags
git push origin --tags

# delete a local tag
git tag -d v1.0.0

# delete a remote tag
git push origin --delete v1.0.0

# closest tag to the current commit
git describe --tags

🧯 I’ve Made a Mistake

# fix the last commit message
git commit --amend

# undo the last commit, keep the changes unstaged
git reset HEAD~1

# undo the last n commits, keep the changes
git reset HEAD~<n>

# undo the last commit and throw the changes away
git reset --hard HEAD~1

# discard changes to one file
git restore <file>

# discard every uncommitted change
git restore .

# restore a file as it was at a commit
git restore --source=<commit> <file>

# undo a commit with a new commit (safe when shared)
git revert <commit>

# stage the revert without committing
git revert -n <commit>

# make the local branch match the remote (fetch first)
git reset --hard origin/<branch>

# find the lost commit...
git reflog

# bring a lost commit back on a new branch
git switch -c <branch> <commit>

git reset modes at a glance:

ModeMoves HEADIndex (staging)Working treeUse it to
--soft✅untoucheduntouchedRecommit differently, keep everything staged
--mixed✅resetuntouchedUnstage but keep the edits (default)
--hard✅resetresetThrow the changes away entirely ⚠️

💡 Nothing committed is really lost for ~90 days: git reflog lists every commit HEAD pointed at, even on deleted branches.

🧹 Cleaning

# dry run: what would be removed
git clean -n

# remove untracked files and directories
git clean -fd

# also remove ignored files (build output, node_modules)
git clean -fdx

# compress and tidy the object database
git gc

# drop unreachable objects
git prune

# check the repository for corruption
git fsck

🐛 Debugging

# begin a binary search for a bad commit
git bisect start

# a commit that is broken (often HEAD)
git bisect bad <commit>

# a commit that was fine
git bisect good <commit>

# let a test script decide automatically
git bisect run <command>

# end the search and return to the original HEAD
git bisect reset

# follow lines moved from other files
git blame -C <file>

🧩 Submodules & Worktrees

# add a submodule
git submodule add <url> <path>

# check out every submodule
git submodule update --init --recursive

# update submodules to their latest commit
git submodule update --remote

# commit each submodule sits on
git submodule status

# check out a second branch side by side
git worktree add ../<dir> <branch>

# list linked working trees
git worktree list

# remove one again
git worktree remove ../<dir>

🧠 Miscellaneous

# rename the local default branch
git branch -m master main

# graph of merge commits only
git log --graph --merges

# export a snapshot without .git
git archive -o release.zip HEAD

# contributions per author
git shortlog -sn --no-merges

# full SHA of the current commit
git rev-parse HEAD

# name of the current branch
git rev-parse --abbrev-ref HEAD

# repository size on disk
git count-objects -vH

# enable background repacking (Git 2.30+)
git maintenance start

Update a feature branch with the latest mainline:

git switch <branch>
git fetch origin <main-branch>
git rebase origin/<main-branch>   # or: git merge origin/<main-branch>

📚 Resources

  • Official documentation
  • Pro Git (free book)
  • Interactive branching tutorial
  • Dangit, Git!?! — recovering from the classic mistakes