Skip to main content
CodinIT provides comprehensive Git integration that goes beyond basic repository management to include advanced features like Git proxy operations, GitHub template integration, and seamless version control workflows.

Overview

The Git integration system offers multiple layers of functionality:

Git Proxy

Remote Git operations through secure proxy

GitHub Templates

Quick project setup from GitHub templates

Version Control

Automatic commits and branch management

Key Features

  • Git Proxy Operations: Execute Git commands on remote repositories
  • Template Integration: Import and use GitHub repository templates
  • Automatic Commits: Seamless version control without manual Git commands
  • Branch Management: Create, switch, and merge branches
  • Repository Sync: Bidirectional synchronization with GitHub
  • Conflict Resolution: Intelligent merge conflict handling
Freedom of Choice: Your code always lives in Git, giving you complete control and the ability to work with any Git-compatible tools or services.

Git Proxy Operations

Remote Git Command Execution

The Git proxy allows secure execution of Git commands on remote repositories: Supported Operations:
  • Repository cloning and fetching
  • Branch creation and switching
  • Commit and push operations
  • Merge conflict resolution
  • Status checking and diff viewing
Usage Example:
# Clone a repository
git clone https://github.com/user/repo.git

# Create and switch to new branch
git checkout -b feature/new-feature

# Push changes
git push origin main

Security and Access Control

Authentication Methods:
  • Personal Access Tokens (PAT)
  • SSH keys (when supported)
  • OAuth integration with GitHub
  • Repository-specific permissions
Security Features:
  • Command validation and sanitization
  • Rate limiting and abuse prevention
  • Audit logging of all operations
  • Secure credential storage

GitHub Template Integration

Template-Based Project Creation

Quickly start projects using GitHub repository templates: Available Template Types:
  • Frontend frameworks (React, Vue, Angular)
  • Backend APIs (Express, FastAPI, NestJS)
  • Full-stack applications
  • Mobile app templates
  • DevOps and deployment templates
Template Usage:
// Import template via API
const template = await fetch('/api/github-template', {
  method: 'POST',
  body: JSON.stringify({
    template: 'facebook/react',
    name: 'my-react-app',
  }),
});

Custom Template Creation

Creating Templates:
  • Convert existing repositories to templates
  • Define template variables and configuration
  • Set up automated setup scripts
  • Include documentation and examples
Template Structure:
template-repo/
├── template.json      # Template configuration
├── setup.js          # Automated setup script
├── README.md         # Usage instructions
└── src/              # Template source code

Repository Management

Creating New Repositories

From Existing Projects:
// API endpoint for repository creation
POST /api/github-template
{
  "action": "create-repo",
  "name": "my-new-project",
  "private": false,
  "description": "Project created with CodinIT"
}
Repository Configuration:
  • Visibility: Public or private repositories
  • Branch Protection: Main branch protection rules
  • Collaborators: Team member access management
  • Topics and Labels: Organization and categorization
  • GitHub Actions: Automated CI/CD workflows

Importing Existing Repositories

Supported Import Methods:
  • Direct GitHub repository URLs
  • GitHub organization repositories
  • Private repository access
  • Large repository handling
Import Process:
// Repository import via API
const importResult = await fetch('/api/git-proxy/import', {
  method: 'POST',
  body: JSON.stringify({
    url: 'https://github.com/user/repo.git',
    branch: 'main',
    depth: 1, // Shallow clone for large repos
  }),
});
Post-Import Setup:
  • Dependency installation
  • Environment configuration
  • Build verification
  • Development server startup

Repository Synchronization

Bidirectional Sync:
  • Automatic commit creation on file changes
  • Pull request synchronization
  • Conflict detection and resolution
  • Branch status monitoring
Sync Configuration:
{
  "sync": {
    "autoCommit": true,
    "pullInterval": 30000,
    "conflictStrategy": "manual",
    "ignorePatterns": [".env", "node_modules"]
  }
}

Advanced Git Operations

Branch Management

Creating and Managing Branches:
# Create new feature branch
git checkout -b feature/user-authentication

# Switch between branches
git checkout main
git checkout feature/user-authentication

# Merge branches
git merge feature/user-authentication
Branch Protection Rules:
  • Required pull request reviews
  • Required status checks
  • Restrictions on force pushes
  • Branch naming conventions

Commit Strategies

Atomic Commits:
  • Each commit represents one logical change
  • Clear, descriptive commit messages
  • Related changes grouped together
  • Easy to understand and revert
Commit Message Conventions:
feat: add user authentication system
fix: resolve login form validation bug
docs: update API documentation
refactor: simplify user state management

Conflict Resolution

Handling Merge Conflicts:
# Check for conflicts
git status

# Resolve conflicts in files
# Then add resolved files
git add resolved-file.js

# Complete the merge
git commit
Prevention Strategies:
  • Regular branch synchronization
  • Clear ownership of code areas
  • Code review requirements
  • Automated testing before merges

Git Hooks and Automation

Pre-commit Quality Checks

Automated Validation:
# .git/hooks/pre-commit
#!/bin/sh
npm run lint
npm run test
npm run type-check
Code Quality Gates:
  • ESLint for code style
  • Prettier for formatting
  • TypeScript type checking
  • Unit test execution

CI/CD Integration

GitHub Actions Workflows:
# .github/workflows/ci.yml
name: CI Pipeline
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '18'
      - name: Install dependencies
        run: npm ci
      - name: Run tests
        run: npm test
      - name: Build project
        run: npm run build
Deployment Automation:
  • Automatic preview deployments
  • Production deployment on merge
  • Rollback capabilities
  • Environment-specific configurations

Troubleshooting

Git Authentication Problems

Common Issues:
  • Expired personal access tokens
  • Incorrect repository permissions
  • Two-factor authentication conflicts
  • SSH key configuration problems
Solutions:
  • Regenerate GitHub personal access tokens
  • Verify repository access permissions
  • Use SSH keys for secure authentication
  • Check token expiration dates

Repository Synchronization Issues

Common Issues:
  • Merge conflicts during sync
  • Divergent branch histories
  • Large file handling problems
  • Network connectivity issues
Solutions:
  • Resolve conflicts manually or use merge tools
  • Force push only when necessary and safe
  • Use Git LFS for large files
  • Check network stability and retry operations

Git Operation Performance

Common Issues:
  • Slow clone operations for large repositories
  • Memory issues with large histories
  • Network latency problems
  • Disk space constraints
Solutions:
  • Use shallow clones for large repositories
  • Implement Git LFS for binary files
  • Optimize network settings
  • Clean up unnecessary branches and tags

Best Practices

Repository Organization

Branch Strategy:
  • main/master: Production-ready code
  • develop: Integration branch for features
  • feature/*: Individual feature development
  • hotfix/*: Critical bug fixes
  • release/*: Release preparation
Commit Hygiene:
  • Write clear, descriptive commit messages
  • Keep commits focused and atomic
  • Use conventional commit format
  • Squash related commits before merging

Collaboration Workflows

Code Review Process:
  • Create feature branches for all changes
  • Submit pull requests for review
  • Require approvals before merging
  • Use automated checks and tests
Team Coordination:
  • Regular branch synchronization
  • Clear ownership of code areas
  • Documentation of processes
  • Regular team communication
Git Mastery: Effective Git usage is a key skill for modern development. Mastering these advanced features will significantly improve your development workflow.
Learn Continuously: Git has extensive capabilities. Consider exploring advanced features like interactive rebasing, advanced merge strategies, and custom hooks.

Branching and merging

When you create or import a repository in CodinIT, you’ll start on the main branch. This is usually the live version of your project. You can do all your work on main, or create branches. Branches allow you to:
  • Work with others without overwriting each other’s changes.
  • Work on different features separately, so unfinished work doesn’t go live.
    For example, if you’re building three new features on the main branch, you’d have to finish all three before publishing. With branches, you can finish and merge each one into main as they’re ready.

Create a new branch in CodinIT

Prerequisite: You must have GitHub connected to CodinIT and a repository already created.
  1. Log in to CodinIT and open a project that is already linked to a GitHub repository.
  2. Click the GitHub icon in the top-right of your screen.
  3. Click Create new branch.
  4. Enter a branch name.
  5. Click Create branch.
You’re now working on your new branch, which is also created in your GitHub repository.

Change branches in CodinIT

Prerequisite: You must have GitHub connected to CodinIT, a repository already created, and multiple branches created.
  1. Log in to CodinIT and open a project that is already linked to a GitHub repository.
  2. Click the GitHub icon in the top-right of your screen.
  3. Select the branch you want to switch to.
CodinIT currently doesn’t support merging branches in-app. You need to merge branches in GitHub.

Committing and fetching

CodinIT saves your work automatically. Every time you make a change that doesn’t break the project, CodinIT creates a commit for you. It also checks GitHub every 30 seconds for any updates made outside CodinIT and pulls those in.
Very rarely, both CodinIT and GitHub might update at almost the same time. If that happens, CodinIT will keep your changes and overwrite the GitHub version.