Skip to content

Commit 35abd44

Browse files
Update integrations/git.mdx
Co-Authored-By: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
1 parent 6d334db commit 35abd44

File tree

1 file changed

+90
-251
lines changed

1 file changed

+90
-251
lines changed

integrations/git.mdx

Lines changed: 90 additions & 251 deletions
Original file line numberDiff line numberDiff line change
@@ -123,301 +123,140 @@ template-repo/
123123
└── src/ # Your code
124124
```
125125

126-
## Repository Management
126+
## Managing Your Projects
127127

128-
### Creating New Repositories
128+
### Creating New Projects
129129

130-
**From Existing Projects:**
130+
**Start a new project:**
131131

132-
```typescript
133-
// API endpoint for repository creation
134-
POST /api/github-template
135-
{
136-
"action": "create-repo",
137-
"name": "my-new-project",
138-
"private": false,
139-
"description": "Project created with CodinIT"
140-
}
141-
```
142-
143-
**Repository Configuration:**
144-
145-
- **Visibility**: Public or private repositories
146-
- **Branch Protection**: Main branch protection rules
147-
- **Collaborators**: Team member access management
148-
- **Topics and Labels**: Organization and categorization
149-
- **GitHub Actions**: Automated CI/CD workflows
150-
151-
### Importing Existing Repositories
152-
153-
**Supported Import Methods:**
154-
155-
- Direct GitHub repository URLs
156-
- GitHub organization repositories
157-
- Private repository access
158-
- Large repository handling
159-
160-
**Import Process:**
161-
162-
```typescript
163-
// Repository import via API
164-
const importResult = await fetch('/api/git-proxy/import', {
165-
method: 'POST',
166-
body: JSON.stringify({
167-
url: 'https://github.com/user/repo.git',
168-
branch: 'main',
169-
depth: 1, // Shallow clone for large repos
170-
}),
171-
});
172-
```
173-
174-
**Post-Import Setup:**
175-
176-
- Dependency installation
177-
- Environment configuration
178-
- Build verification
179-
- Development server startup
180-
181-
### Repository Synchronization
182-
183-
**Bidirectional Sync:**
184-
185-
- Automatic commit creation on file changes
186-
- Pull request synchronization
187-
- Conflict detection and resolution
188-
- Branch status monitoring
189-
190-
**Sync Configuration:**
191-
192-
```json
193-
{
194-
"sync": {
195-
"autoCommit": true,
196-
"pullInterval": 30000,
197-
"conflictStrategy": "manual",
198-
"ignorePatterns": [".env", "node_modules"]
199-
}
200-
}
201-
```
202-
203-
## Advanced Git Operations
204-
205-
### Branch Management
206-
207-
**Creating and Managing Branches:**
132+
You can create a new GitHub repository right from CodinIT:
133+
- Choose public (anyone can see) or private (only you can see)
134+
- Add a description
135+
- Set up protection rules
136+
- Add team members
137+
- Set up automatic testing
208138

209-
```bash
210-
# Create new feature branch
211-
git checkout -b feature/user-authentication
212-
213-
# Switch between branches
214-
git checkout main
215-
git checkout feature/user-authentication
216-
217-
# Merge branches
218-
git merge feature/user-authentication
219-
```
220-
221-
**Branch Protection Rules:**
222-
223-
- Required pull request reviews
224-
- Required status checks
225-
- Restrictions on force pushes
226-
- Branch naming conventions
227-
228-
### Commit Strategies
229-
230-
**Atomic Commits:**
231-
232-
- Each commit represents one logical change
233-
- Clear, descriptive commit messages
234-
- Related changes grouped together
235-
- Easy to understand and revert
236-
237-
**Commit Message Conventions:**
238-
239-
```
240-
feat: add user authentication system
241-
fix: resolve login form validation bug
242-
docs: update API documentation
243-
refactor: simplify user state management
244-
```
139+
### Bringing in Existing Projects
245140

246-
### Conflict Resolution
141+
**Import from GitHub:**
247142

248-
**Handling Merge Conflicts:**
143+
You can bring in projects you already have on GitHub:
144+
- Paste the GitHub URL
145+
- Choose which branch to use
146+
- CodinIT will download it and set it up
249147

250-
```bash
251-
# Check for conflicts
252-
git status
253-
254-
# Resolve conflicts in files
255-
# Then add resolved files
256-
git add resolved-file.js
257-
258-
# Complete the merge
259-
git commit
260-
```
261-
262-
**Prevention Strategies:**
263-
264-
- Regular branch synchronization
265-
- Clear ownership of code areas
266-
- Code review requirements
267-
- Automated testing before merges
268-
269-
## Git Hooks and Automation
148+
After importing:
149+
- Install needed tools
150+
- Set up settings
151+
- Make sure it builds correctly
152+
- Start the development server
270153

271-
### Pre-commit Quality Checks
272-
273-
**Automated Validation:**
274-
275-
```bash
276-
# .git/hooks/pre-commit
277-
#!/bin/sh
278-
npm run lint
279-
npm run test
280-
npm run type-check
281-
```
282-
283-
**Code Quality Gates:**
284-
285-
- ESLint for code style
286-
- Prettier for formatting
287-
- TypeScript type checking
288-
- Unit test execution
289-
290-
### CI/CD Integration
291-
292-
**GitHub Actions Workflows:**
293-
294-
```yaml
295-
# .github/workflows/ci.yml
296-
name: CI Pipeline
297-
on: [push, pull_request]
298-
299-
jobs:
300-
test:
301-
runs-on: ubuntu-latest
302-
steps:
303-
- uses: actions/checkout@v3
304-
- name: Setup Node.js
305-
uses: actions/setup-node@v3
306-
with:
307-
node-version: '18'
308-
- name: Install dependencies
309-
run: npm ci
310-
- name: Run tests
311-
run: npm test
312-
- name: Build project
313-
run: npm run build
314-
```
154+
### Keeping Things in Sync
315155

316-
**Deployment Automation:**
156+
**Automatic syncing:**
317157

318-
- Automatic preview deployments
319-
- Production deployment on merge
320-
- Rollback capabilities
321-
- Environment-specific configurations
158+
CodinIT keeps your code in sync with GitHub:
159+
- Saves changes automatically
160+
- Checks for updates every 30 seconds
161+
- Helps fix conflicts
162+
- Watches branch status
322163

323-
## Troubleshooting
164+
## Common Problems and Solutions
324165

325166
<AccordionGroup>
326-
<Accordion title="Authentication Issues" icon="key">
327-
### Git Authentication Problems
167+
<Accordion title="Login Problems" icon="key">
168+
### Can't Connect to GitHub
328169

329-
**Common Issues:**
330-
- Expired personal access tokens
331-
- Incorrect repository permissions
332-
- Two-factor authentication conflicts
333-
- SSH key configuration problems
170+
**Common problems:**
171+
- Your access token expired
172+
- You don't have permission
173+
- Two-factor authentication issues
174+
- SSH key problems
334175

335-
**Solutions:**
336-
- Regenerate GitHub personal access tokens
337-
- Verify repository access permissions
338-
- Use SSH keys for secure authentication
339-
- Check token expiration dates
176+
**How to fix:**
177+
- Make a new GitHub access token
178+
- Check your repository permissions
179+
- Use SSH keys for better security
180+
- Check when your token expires
340181

341182
</Accordion>
342183

343-
<Accordion title="Sync Conflicts" icon="git-merge">
344-
### Repository Synchronization Issues
184+
<Accordion title="Sync Problems" icon="git-merge">
185+
### Code Won't Sync
345186

346-
**Common Issues:**
347-
- Merge conflicts during sync
348-
- Divergent branch histories
349-
- Large file handling problems
350-
- Network connectivity issues
187+
**Common problems:**
188+
- Conflicts when merging
189+
- Branches went different directions
190+
- Large files causing issues
191+
- Internet connection problems
351192

352-
**Solutions:**
353-
- Resolve conflicts manually or use merge tools
354-
- Force push only when necessary and safe
355-
- Use Git LFS for large files
356-
- Check network stability and retry operations
193+
**How to fix:**
194+
- Fix conflicts by hand
195+
- Only force push when you're sure it's safe
196+
- Use Git LFS for big files
197+
- Check your internet and try again
357198

358199
</Accordion>
359200

360-
<Accordion title="Performance Issues" icon="gauge">
361-
### Git Operation Performance
201+
<Accordion title="Slow Performance" icon="gauge">
202+
### Git is Slow
362203

363-
**Common Issues:**
364-
- Slow clone operations for large repositories
365-
- Memory issues with large histories
366-
- Network latency problems
367-
- Disk space constraints
204+
**Common problems:**
205+
- Big projects take forever to download
206+
- Running out of memory
207+
- Slow internet
208+
- Not enough disk space
368209

369-
**Solutions:**
370-
- Use shallow clones for large repositories
371-
- Implement Git LFS for binary files
372-
- Optimize network settings
373-
- Clean up unnecessary branches and tags
210+
**How to fix:**
211+
- Use shallow clones (download less history)
212+
- Use Git LFS for binary files
213+
- Check your internet connection
214+
- Delete old branches you don't need
374215

375216
</Accordion>
376217
</AccordionGroup>
377218

378-
## Best Practices
219+
## Good Habits
379220

380-
### Repository Organization
221+
### Organizing Your Code
381222

382-
**Branch Strategy:**
223+
**Branch names:**
383224

384-
- `main`/`master`: Production-ready code
385-
- `develop`: Integration branch for features
386-
- `feature/*`: Individual feature development
387-
- `hotfix/*`: Critical bug fixes
388-
- `release/*`: Release preparation
225+
- `main`: The working version
226+
- `develop`: Where you combine new features
227+
- `feature/*`: New features you're building
228+
- `hotfix/*`: Quick fixes for urgent bugs
229+
- `release/*`: Getting ready to release
389230

390-
**Commit Hygiene:**
231+
**Commit messages:**
391232

392-
- Write clear, descriptive commit messages
393-
- Keep commits focused and atomic
394-
- Use conventional commit format
395-
- Squash related commits before merging
233+
- Write clear messages about what you changed
234+
- Keep each commit focused on one thing
235+
- Use a standard format
236+
- Combine related commits before merging
396237

397-
### Collaboration Workflows
238+
### Working with Others
398239

399-
**Code Review Process:**
240+
**Code review:**
400241

401-
- Create feature branches for all changes
402-
- Submit pull requests for review
403-
- Require approvals before merging
404-
- Use automated checks and tests
242+
- Make a branch for each change
243+
- Ask others to review your code
244+
- Get approval before merging
245+
- Use automatic tests
405246

406-
**Team Coordination:**
247+
**Team coordination:**
407248

408-
- Regular branch synchronization
409-
- Clear ownership of code areas
410-
- Documentation of processes
411-
- Regular team communication
249+
- Sync branches regularly
250+
- Know who's working on what
251+
- Write down your processes
252+
- Talk to your team often
412253

413254
<Callout type="info">
414-
**Git Mastery**: Effective Git usage is a key skill for modern development. Mastering these advanced features will
415-
significantly improve your development workflow.
255+
**Git is Important**: Learning Git well will make you a better developer. These skills help you work on any project.
416256
</Callout>
417257

418258
<Callout type="tip">
419-
**Learn Continuously**: Git has extensive capabilities. Consider exploring advanced features like interactive
420-
rebasing, advanced merge strategies, and custom hooks.
259+
**Keep Learning**: Git can do a lot more than what's covered here. Explore features like rebasing and custom hooks as you get more comfortable.
421260
</Callout>
422261

423262
## Branching and merging

0 commit comments

Comments
 (0)