Skip to content

Commit da54374

Browse files
committed
docs: Cleanup README
1 parent f72eaf5 commit da54374

File tree

1 file changed

+92
-78
lines changed

1 file changed

+92
-78
lines changed

README.md

Lines changed: 92 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ A powerful command-line tool for managing multiple Git configuration profiles. S
88
![License](https://img.shields.io/github/license/techquestsdev/git-context)
99
![Latest Release](https://img.shields.io/github/v/release/techquestsdev/git-context?include_prereleases)
1010

11-
## Features
11+
## Features
1212

13-
- 🎯 **Multiple Profiles** - Create and manage unlimited Git configuration profiles
14-
- **Instant Switching** - Switch between profiles with a single command
15-
- 🌍 **Global Settings** - Define shared configuration across all profiles
16-
- 🔗 **URL Rewrites** - Configure Git URL rewrites per profile (SSH <-> HTTPS)
17-
- 🛡️ **Safe Operations** - Automatic backups before switching profiles
18-
- 💬 **Interactive Setup** - Guided profile creation with prompts
19-
- 🎨 **Colored Output** - Beautiful, easy-to-read CLI output
20-
- 📝 **YAML Configuration** - Simple, human-readable configuration format
13+
- **Multiple Profiles** - Create and manage unlimited Git configuration profiles
14+
- **Instant Switching** - Switch between profiles with a single command
15+
- **Global Settings** - Define shared configuration across all profiles
16+
- **URL Rewrites** - Configure Git URL rewrites per profile (SSH <-> HTTPS)
17+
- **Safe Operations** - Automatic backups before switching profiles
18+
- **Interactive Setup** - Guided profile creation with prompts
19+
- **Colored Output** - Beautiful, easy-to-read CLI output
20+
- **YAML Configuration** - Simple, human-readable configuration format
2121

22-
## 🚀 Installation
22+
## Installation
2323

24-
### 📦 Quick Install (Recommended)
24+
### Quick Install (Recommended)
2525

2626
#### Using Go Install
2727

@@ -52,7 +52,7 @@ curl -L https://github.com/techquestsdev/git-context/releases/latest/download/gi
5252
sudo mv git-context /usr/local/bin/
5353
```
5454

55-
### 🛠️ Build from Source
55+
### Build from Source
5656

5757
#### Prerequisites
5858

@@ -82,7 +82,7 @@ go install
8282
git-context --version
8383
```
8484

85-
## 📖 Usage
85+
## Usage
8686

8787
### Quick Start Guide
8888

@@ -124,7 +124,7 @@ Profile Email Status
124124
------- ----- ------
125125
work andre@work.com ● (active)
126126
personal andre@personal.com
127-
school andre@school.edu
127+
university andre@university.edu
128128
```
129129

130130
#### 4. Switch Between Profiles
@@ -158,24 +158,24 @@ git-context show work
158158
#### 7. Remove a Profile
159159

160160
```bash
161-
git-context remove school
161+
git-context remove university
162162
```
163163

164164
### All Available Commands
165165

166-
| Command | Description |
167-
| ---------------------------- | ----------------------------------- |
168-
| `git-context init` | Initialize configuration |
169-
| `git-context add <name>` | Create a new profile |
170-
| `git-context switch <name>` | Switch to a profile |
171-
| `git-context list` | List all profiles |
172-
| `git-context current` | Show active profile |
173-
| `git-context show <name>` | Show profile details |
174-
| `git-context remove <name>` | Delete a profile |
175-
| `git-context --help` | Show help |
176-
| `git-context --version` | Show version |
166+
| Command | Description |
167+
| --------------------------- | ------------------------ |
168+
| `git-context init` | Initialize configuration |
169+
| `git-context add <name>` | Create a new profile |
170+
| `git-context switch <name>` | Switch to a profile |
171+
| `git-context list` | List all profiles |
172+
| `git-context current` | Show active profile |
173+
| `git-context show <name>` | Show profile details |
174+
| `git-context remove <name>` | Delete a profile |
175+
| `git-context --help` | Show help |
176+
| `git-context --version` | Show version |
177177

178-
## ⚙️ Configuration
178+
## Configuration
179179

180180
The configuration is stored in YAML format at `~/.config/git-context/config.yaml`.
181181

@@ -192,7 +192,7 @@ profiles:
192192
user:
193193
name: "Your Name"
194194
email: "your.email@example.com"
195-
signingkey: "GPG_KEY_ID" # optional
195+
signingkey: "GPG_KEY_ID" # optional
196196
url:
197197
- pattern: "ssh://git@gitlab.com/"
198198
insteadOf: "https://gitlab.com/"
@@ -205,7 +205,7 @@ profiles:
205205
global:
206206
core:
207207
pager: delta
208-
editor: vim
208+
editor: nvim
209209
push:
210210
autoSetupRemote: true
211211
merge:
@@ -221,11 +221,11 @@ profiles:
221221
work:
222222
user:
223223
name: "Andre Nogueira"
224-
email: "andre.nogueira@mollie.com"
224+
email: "aanogueira@techquests.dev"
225225
signingkey: "A0A90F4231D8B028"
226226
url:
227-
- pattern: "git@gitlab.molops.io/"
228-
insteadOf: "https://gitlab.molops.io/"
227+
- pattern: "git@git.techquests.dev/"
228+
insteadOf: "https://git.techquests.dev/"
229229
- pattern: "ssh://git@github.com/"
230230
insteadOf: "https://github.com/"
231231
http:
@@ -234,15 +234,17 @@ profiles:
234234
personal:
235235
user:
236236
name: "Andre Nogueira"
237-
email: "andre@personal.com"
237+
email: "aanogueira@protonmail.com"
238+
signingkey: "B1C2D3E4F5G6H7I8"
238239
url:
239240
- pattern: "ssh://git@github.com/"
240241
insteadOf: "https://github.com/"
241242

242-
school:
243+
university:
243244
user:
244-
name: "Andre N."
245-
email: "andre@school.edu"
245+
name: "Andre Nogueira"
246+
email: "aanogueira@university.edu"
247+
signingkey: "C1D2E3F4G5H6I7J8"
246248
```
247249
248250
### Global vs Profile-Specific Settings
@@ -253,22 +255,34 @@ profiles:
253255
254256
### Common Configuration Sections
255257
256-
| Section | Purpose | Examples |
257-
| -------------- | -------------------------------------- | ------------------------------------- |
258-
| `user` | User identity | name, email, signingkey |
259-
| `core` | Core Git settings | editor, pager, autocrlf |
260-
| `push` | Push behavior | default, autoSetupRemote |
261-
| `pull` | Pull behavior | rebase, ff |
262-
| `merge` | Merge strategies | conflictStyle, tool |
263-
| `commit` | Commit settings | gpgsign, template |
264-
| `gpg` | GPG configuration | program, format |
265-
| `url` | URL rewrites | pattern, insteadOf |
266-
| `http` | HTTP settings | postBuffer, sslVerify |
267-
| `delta` | Delta pager configuration | navigate, line-numbers |
268-
269-
> Based on my personal configuration needs.
270-
271-
## 🎯 Use Cases
258+
| Section | Purpose | Parameters |
259+
| ------------- | ----------------------------- | ---------------------- |
260+
| `add` | Add settings | \<key\>: \<value\> |
261+
| `alias` | Create shortcuts for commands | \<alias\>: \<command\> |
262+
| `branch` | Branch management | \<key\>: \<value\> |
263+
| `column` | Column layout settings | \<key\>: \<value\> |
264+
| `commit` | Commit message templates | \<key\>: \<value\> |
265+
| `core` | Core Git settings | \<key\>: \<value\> |
266+
| `custom` | Custom settings | \<key\>: \<value\> |
267+
| `delta` | Delta pager settings | \<key\>: \<value\> |
268+
| `diff` | Diff settings | \<key\>: \<value\> |
269+
| `feature` | Feature settings | \<key\>: \<value\> |
270+
| `fetch` | Fetch settings | \<key\>: \<value\> |
271+
| `gpg` | GPG settings | \<key\>: \<value\> |
272+
| `http` | HTTP settings | \<key\>: \<value\> |
273+
| `init` | Initialization settings | \<key\>: \<value\> |
274+
| `interactive` | Interactive settings | \<key\>: \<value\> |
275+
| `maintenance` | Maintenance settings | \<key\>: \<value\> |
276+
| `merge` | Merge settings | \<key\>: \<value\> |
277+
| `pull` | Pull settings | \<key\>: \<value\> |
278+
| `push` | Push settings | \<key\>: \<value\> |
279+
| `rebase` | Rebase settings | \<key\>: \<value\> |
280+
| `rerere` | Rerere settings | \<key\>: \<value\> |
281+
| `tag` | Tag settings | \<key\>: \<value\> |
282+
| `url` | URL settings | \<key\>: \<value\> |
283+
| `user` | User settings | \<key\>: \<value\> |
284+
285+
## Use Cases
272286

273287
### Scenario 1: Work vs Personal Repositories
274288

@@ -318,23 +332,23 @@ Configure SSH access for different Git hosts:
318332
profiles:
319333
work:
320334
url:
321-
- pattern: "ssh://git@gitlab.company.com/"
322-
insteadOf: "https://gitlab.company.com/"
335+
- pattern: "ssh://git@git.company.com/"
336+
insteadOf: "https://git.company.com/"
323337
personal:
324338
url:
325339
- pattern: "ssh://git@github.com/"
326340
insteadOf: "https://github.com/"
327341
```
328342

329-
## 🛡️ Safety Features
343+
## Safety Features
330344

331-
- **Automatic Backups** - Before switching profiles, current Git config is backed up to `~/.gitconfig.bak`
332-
- **Confirmation Prompts** - Destructive operations require user confirmation
333-
- **Validation** - Profiles are validated before being applied
334-
- **Error Handling** - Clear error messages guide you when something goes wrong
335-
- **Non-Destructive Init** - `init` command preserves existing profiles
345+
- **Automatic Backups** - Before switching profiles, current Git config is backed up to `~/.gitconfig.bak`
346+
- **Confirmation Prompts** - Destructive operations require user confirmation
347+
- **Validation** - Profiles are validated before being applied
348+
- **Error Handling** - Clear error messages guide you when something goes wrong
349+
- **Non-Destructive Init** - `init` command preserves existing profiles
336350

337-
## 🐛 Troubleshooting
351+
## Troubleshooting
338352

339353
### Config File Not Found
340354

@@ -377,7 +391,7 @@ cp ~/.gitconfig.bak ~/.gitconfig
377391

378392
**Solution:** This is expected! The `init` command now preserves existing profiles instead of clearing them.
379393

380-
## 🧪 Testing
394+
## Testing
381395

382396
The project has comprehensive test coverage and zero linting issues, leveraging Go's testing framework and `golangci-lint` for code quality.
383397

@@ -428,13 +442,13 @@ make all
428442

429443
### Test Categories
430444

431-
- **Configuration Management** - Profile CRUD, merging, persistence
432-
- **Git Operations** - Config file parsing, URL rewrites, backups
433-
- **UI Components** - Colored output, tables, formatting
434-
- **Command Integration** - Profile operations, error handling
435-
- **Edge Cases** - Invalid YAML, missing files, error paths
445+
- **Configuration Management** - Profile CRUD, merging, persistence
446+
- **Git Operations** - Config file parsing, URL rewrites, backups
447+
- **UI Components** - Colored output, tables, formatting
448+
- **Command Integration** - Profile operations, error handling
449+
- **Edge Cases** - Invalid YAML, missing files, error paths
436450

437-
## 🏗️ Architecture
451+
## Architecture
438452

439453
### Project Structure
440454

@@ -475,14 +489,14 @@ git-context/
475489
- **User Experience** - Colored output, clear messages, confirmation prompts
476490
- **Safety First** - Automatic backups, validation, error handling
477491

478-
## 📦 Dependencies
492+
## Dependencies
479493

480494
- [github.com/spf13/cobra](https://github.com/spf13/cobra) - CLI framework
481495
- [github.com/manifoldco/promptui](https://github.com/manifoldco/promptui) - Interactive prompts
482496
- [github.com/fatih/color](https://github.com/fatih/color) - Colored terminal output
483497
- [gopkg.in/yaml.v3](https://gopkg.in/yaml.v3) - YAML parsing and serialization
484498

485-
## 🤝 Contributing
499+
## Contributing
486500

487501
Contributions are welcome! Please follow these steps:
488502

@@ -494,11 +508,11 @@ Contributions are welcome! Please follow these steps:
494508

495509
### Before Submitting
496510

497-
- Ensure all tests pass (`go test -v ./...`)
498-
- Maintain or improve code coverage
499-
- Follow existing code style
500-
- Add tests for new features
501-
- Update documentation as needed
511+
- Ensure all tests pass (`go test -v ./...`)
512+
- Maintain or improve code coverage
513+
- Follow existing code style
514+
- Add tests for new features
515+
- Update documentation as needed
502516

503517
### Development Commands
504518

@@ -545,17 +559,17 @@ make version # Show Go version
545559
make all # Run fmt, lint, test, and build
546560
```
547561

548-
## 📄 License
562+
## License
549563

550564
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
551565

552-
## 🙏 Acknowledgments
566+
## Acknowledgments
553567

554568
- [Cobra](https://github.com/spf13/cobra) for the excellent CLI framework
555569
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) ecosystem for inspiration
556570
- [PromptUI](https://github.com/manifoldco/promptui) for interactive prompts
557571

558-
## 📧 Contact
572+
## Contact
559573

560574
André Nogueira - [@aanogueira](https://github.com/aanogueira)
561575

0 commit comments

Comments
 (0)