Skip to main content

Git Integration

Overview

Codebolt provides seamless Git integration, allowing you to manage your version control directly within the editor. View commit history, make commits, manage branches, and collaborate with your team without leaving your development environment.

Git Commits View

Commit History

  • Visual Timeline: See your project's commit history in a clean, visual format
  • Commit Details: View commit messages, authors, timestamps, and file changes
  • Branch Visualization: Track different branches and their relationships
  • Search Commits: Find specific commits by message, author, or file changes

Commit Information Display

commit abc123def456
Author: John Doe <[email protected]>
Date: Mon Jan 15 14:30:22 2024 +0000

feat: Add user authentication system

- Implement JWT token authentication
- Add login/logout functionality
- Create user session management

Files changed: 5 (+120, -15)

Interactive Commit List

  • Click to View: Click any commit to see detailed changes
  • File Diff Preview: Preview changes made in each commit
  • Commit Navigation: Navigate between commits with keyboard shortcuts
  • Filter Options: Filter commits by author, date range, or branch

Git Operations

Basic Git Commands

  • Status: See current working directory status
  • Add Files: Stage files for commit
  • Commit: Create new commits with messages
  • Push/Pull: Sync with remote repositories
  • Branch Management: Create, switch, and manage branches

Staging Area

  • Visual Staging: Drag and drop files to stage/unstage
  • Partial Staging: Stage specific lines or hunks
  • Smart Staging: AI-powered suggestions for what to stage
  • Bulk Operations: Stage/unstage multiple files at once

Commit Creation

Commit Message Guidelines:
- feat: New feature implementation
- fix: Bug fixes
- docs: Documentation changes
- style: Code formatting changes
- refactor: Code restructuring
- test: Adding or updating tests
- chore: Maintenance tasks

Branch Management

Branch Operations

  • Create Branch: Create new branches from current or specific commits
  • Switch Branch: Quickly switch between branches
  • Merge Branches: Merge branches with conflict resolution
  • Delete Branch: Remove merged or unused branches

Branch Visualization

  • Branch Graph: Visual representation of branch relationships
  • Merge Points: Clear indication of where branches merge
  • Divergence Tracking: See how branches have diverged from main
  • Remote Tracking: Track relationships with remote branches

Branch Protection

  • Protected Branches: Configure branch protection rules
  • Review Requirements: Require code reviews before merging
  • Status Checks: Require CI/CD checks to pass
  • Restricted Push: Control who can push to specific branches

Remote Repository Management

Remote Configuration

  • Multiple Remotes: Configure multiple remote repositories
  • Remote URLs: Manage HTTPS and SSH remote URLs
  • Authentication: Handle authentication for different remotes
  • Default Remote: Set default remote for push/pull operations

Synchronization

  • Fetch: Retrieve latest changes from remote without merging
  • Pull: Fetch and merge changes from remote branch
  • Push: Send local commits to remote repository
  • Force Push: Handle force push operations safely

Conflict Resolution

  • Merge Conflicts: Visual conflict resolution interface
  • Three-Way Merge: Compare base, local, and remote changes
  • Conflict Markers: Clear highlighting of conflict areas
  • Resolution Tools: Built-in tools to resolve conflicts

Git Workflow Integration

Feature Branch Workflow

  1. Create Feature Branch: git checkout -b feature/new-feature
  2. Develop and Commit: Make changes and commit regularly
  3. Push to Remote: git push origin feature/new-feature
  4. Create Pull Request: Initiate code review process
  5. Merge and Cleanup: Merge to main and delete feature branch

GitFlow Integration

  • Master/Main Branch: Production-ready code
  • Develop Branch: Integration branch for features
  • Feature Branches: Individual feature development
  • Release Branches: Prepare releases
  • Hotfix Branches: Critical production fixes

AI-Powered Git Features

  • Smart Commit Messages: AI-generated commit messages based on changes
  • Conflict Resolution Suggestions: AI-powered merge conflict resolution
  • Code Review Insights: AI analysis of changes and potential issues
  • Branch Naming Suggestions: Intelligent branch name recommendations

Git Settings and Configuration

User Configuration

# Set user information
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

# Set default editor
git config --global core.editor "codebolt"

# Set default branch name
git config --global init.defaultBranch main

Repository Settings

  • Ignore Files: Configure .gitignore rules
  • Attributes: Set up .gitattributes for file handling
  • Hooks: Configure Git hooks for automation
  • Aliases: Create custom Git command shortcuts

Integration Settings

  • Auto-fetch: Automatically fetch remote changes
  • Auto-pull: Automatically pull on branch switch
  • Commit Templates: Use templates for consistent commit messages
  • GPG Signing: Configure commit signing for security

Advanced Git Features

Interactive Rebase

  • Commit Reordering: Change the order of commits
  • Commit Squashing: Combine multiple commits into one
  • Commit Editing: Modify commit messages or content
  • Commit Splitting: Split one commit into multiple

Git Stash

  • Stash Changes: Temporarily save uncommitted changes
  • Stash List: View all saved stashes
  • Apply Stash: Restore stashed changes
  • Stash Pop: Apply and remove stash from list

Git Log and History

  • Advanced Filtering: Filter history by various criteria
  • Graph View: Visualize branch and merge history
  • Blame View: See who last modified each line
  • Bisect: Find commits that introduced bugs

Collaboration Features

Code Review Integration

  • Pull Request View: Review pull requests within the editor
  • Inline Comments: Add comments directly on code lines
  • Review Status: Track review approval status
  • Change Requests: Handle requested changes

Team Collaboration

  • Contributor Insights: See team member contributions
  • Activity Timeline: Track team activity across branches
  • Notification System: Get notified of important Git events
  • Access Control: Manage team member permissions

Troubleshooting

Common Issues

  • Merge Conflicts: Step-by-step conflict resolution guide
  • Detached HEAD: Understanding and fixing detached HEAD state
  • Large Files: Handling large files with Git LFS
  • Authentication: Troubleshooting Git authentication issues

Recovery Operations

  • Undo Commits: Various ways to undo commits safely
  • Recover Lost Commits: Find and recover lost work
  • Reset Operations: Understanding hard, soft, and mixed resets
  • Reflog: Use reflog to recover from mistakes

Performance Optimization

  • Large Repositories: Optimize performance for large repos
  • Shallow Clones: Use shallow clones for faster operations
  • Sparse Checkout: Work with subset of repository files
  • Git Maintenance: Regular maintenance for optimal performance