← Back to Git Course | Chapter 10: Tools & Internals | Lesson 3 of 8

Git IntelliJ Integration

IntelliJ का Git support आपके coding workshop में एक built-in helper रखने जैसा है जो आपके changes देखता है और आपको room छोड़े बिना उन्हें save करने देता है।

IntelliJ Git Integration

JetBrains IntelliJ IDEA में built-in Git integration है। जब आप एक Git project खोलते हैं, IntelliJ automatically changes index करता है, Project panel के अंदर modified files को blue में और untracked files को green में highlight करता है।

उदाहरण: IntelliJ Git Integration

bash
# Open a Git project; IntelliJ highlights modified files in blue and untracked files in green

Commit और Push करना

files stage करने और messages लिखने के लिए Commit tool window (macOS पर Cmd+K, Windows पर Ctrl+K) इस्तेमाल करें। commits को अपने remote server पर भेजने के लिए Push dialog (Cmd+Shift+K या Ctrl+Shift+K) इस्तेमाल करें।

उदाहरण: Committing and Pushing

bash
# Cmd+K (Ctrl+K) opens Commit; Cmd+Shift+K (Ctrl+Shift+K) opens Push

IntelliJ में Branches Manage करना

IntelliJ के status bar में branch indicator local और remote branches साथ list करने वाला एक popup खोलता है — वहाँ से आप एक checkout कर सकते हैं, अपनी current commit से एक नई बना सकते हैं, या terminal छुए बिना अपनी current में दूसरी branch merge कर सकते हैं।

उदाहरण: Managing Branches in IntelliJ

bash
# Click the branch indicator in the status bar to checkout, create, or merge a branch

Local History देखना

IntelliJ में एक independent Local History safety net है। अगर आप commit करने से पहले code delete कर दें, file पर right-click करें और पिछली, unsaved file states आसानी से restore करने के लिए Local History select करें।

उदाहरण: Viewing Local History

bash
# Right-click a file, select Local History, to restore a previous unsaved state

Visual Git Log

editor window के नीचे Git tab एक पूरा visual log display करता है। यह सारी branches, commit authors, hashes, और detailed file modification structures को एक clean interactive grid के अंदर list करता है।

उदाहरण: Visual Git Log

bash
# Open the Git tab to see branches, authors, hashes, and file modifications in a grid
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. Commit window में files को unchecked छोड़ना और फिर सोचना कि change commit से क्यों missing है।
  2. Commit and Push के बजाय Commit click करना और change के remote पर होने की उम्मीद करना।
  3. .idea/ folder को ignore करना, और .gitignore में belong करने वाली IDE settings commit करना।

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.