Skip to content

Commit ed5b99d

Browse files
authored
Merge pull request #144 from RafaelJohn9/develop
Develop
2 parents 0e8eba4 + 29ec15c commit ed5b99d

49 files changed

Lines changed: 23502 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-docs.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master] # or your default branch
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '18'
31+
cache: 'npm'
32+
cache-dependency-path: './docs/package-lock.json'
33+
34+
- name: Install dependencies
35+
run: |
36+
cd docs
37+
npm ci
38+
39+
- name: Build website
40+
run: |
41+
cd docs
42+
npm run build
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v3
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v2
49+
with:
50+
path: './docs/build'
51+
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v2

docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

docs/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
## Installation
6+
7+
```bash
8+
yarn
9+
```
10+
11+
## Local Development
12+
13+
```bash
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```bash
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
Using SSH:
30+
31+
```bash
32+
USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```bash
38+
GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
---
2+
title: "gh-templates gitignore add"
3+
sidebar_label: "gitignore add"
4+
---
5+
6+
# Add Gitignore Templates
7+
8+
Add one or more gitignore templates to your repository.
9+
10+
## Usage
11+
12+
```bash
13+
gh-templates gitignore add [OPTIONS] [TEMPLATE]...
14+
```
15+
16+
## Arguments
17+
18+
| Argument | Description |
19+
|-----------------|------------------------------------------------------------------|
20+
| `[TEMPLATE]...` | Gitignore template names to add (e.g., rust, python, global/windows) |
21+
22+
## Options
23+
24+
| Option | Description |
25+
|-------------------------------|-----------------------------------------------------------------------------|
26+
| `--dir <DIR>` | Directory to save the `.gitignore` file |
27+
| `--force` | Force overwrite existing `.gitignore` file |
28+
| `--all` | Download all available templates |
29+
| `-a, --append` | Append to the existing `.gitignore` file instead of overwriting |
30+
| `--update-cache` | Update the gitignore template cache |
31+
| `-n, --use-remote-name` | Use the remote template file name as the output file name |
32+
| `-o, --output <FILENAME>...` | Output file name(s) (default: `.gitignore`) |
33+
| `-h, --help` | Print help |
34+
35+
## Examples
36+
37+
### Add a Single Template
38+
39+
```bash
40+
gh-templates gitignore add rust
41+
```
42+
43+
Downloads the Rust gitignore template and saves it as `.gitignore` in the repository root.
44+
45+
### Add Multiple Templates
46+
47+
```bash
48+
gh-templates gitignore add rust docker vscode
49+
```
50+
51+
Combines multiple gitignore templates into a single comprehensive file.
52+
53+
### Custom Output Directory
54+
55+
```bash
56+
gh-templates gitignore add python --dir backend/
57+
```
58+
59+
Saves the gitignore file to a custom directory (useful for monorepos).
60+
61+
### Custom File Names
62+
63+
```bash
64+
gh-templates gitignore add rust python -o .gitignore.rust -o .gitignore.python
65+
```
66+
67+
Creates separate gitignore files for each template.
68+
69+
### Force Overwrite
70+
71+
```bash
72+
gh-templates gitignore add node --force
73+
```
74+
75+
Overwrites existing `.gitignore` file without prompting.
76+
77+
### Add All Templates
78+
79+
```bash
80+
gh-templates gitignore add --all
81+
```
82+
83+
Downloads and combines all available gitignore templates (creates a very comprehensive file ~ Not Recommended).
84+
85+
### Append to Existing File
86+
87+
```bash
88+
gh-templates gitignore add python --append
89+
```
90+
91+
Appends the Python template to the existing `.gitignore` file.
92+
93+
### Use Remote Template Name
94+
95+
```bash
96+
gh-templates gitignore add rust -n
97+
```
98+
99+
Saves the template using its remote file name (e.g., `Rust.gitignore`).
100+
101+
### Update Template Cache
102+
103+
```bash
104+
gh-templates gitignore add --update-cache
105+
```
106+
107+
Updates the local cache of available gitignore templates.
108+
109+
### Complex Example
110+
111+
```bash
112+
gh-templates gitignore add rust docker windows --dir . --force -o .gitignore
113+
```
114+
115+
This command:
116+
117+
- Adds Rust, Docker, and Windows gitignore patterns
118+
- Saves to repository root directory
119+
- Forces overwrite of existing file
120+
- Uses explicit output filename
121+
122+
## Default Behavior
123+
124+
- **Output Directory**: Repository root (`.`)
125+
- **File Names**: `.gitignore` (single file containing all patterns)
126+
- **Overwrite**: Prompts before overwriting existing files (unless `--force` is used)
127+
- **Append**: By default, overwrites unless `--append` is specified
128+
- **Combination**: Multiple templates are merged into one file
129+
130+
## Template Combination
131+
132+
When adding multiple templates, `gh-templates` intelligently combines them:
133+
134+
1. **Categorization**: Groups patterns by category with comments
135+
136+
## Best Practices for Combining
137+
138+
### Language + OS + Editor
139+
140+
```bash
141+
gh-templates gitignore add python windows vscode
142+
```
143+
144+
### Full Stack Project
145+
146+
```bash
147+
gh-templates gitignore add javascript python docker
148+
```
149+
150+
### Polyglot Repository
151+
152+
```bash
153+
gh-templates gitignore add rust go python java
154+
```
155+
156+
## Monorepo Strategy
157+
158+
For monorepos with multiple projects:
159+
160+
```bash
161+
# Root-level common ignores
162+
gh-templates gitignore add windows macos linux
163+
164+
# Language-specific ignores in subdirectories
165+
gh-templates gitignore add rust --dir rust-service/
166+
gh-templates gitignore add node --dir web-frontend/
167+
gh-templates gitignore add python --dir python-api/
168+
```
169+
170+
## Updating Gitignore
171+
172+
To update an existing `.gitignore`:
173+
174+
1. **Preview changes** first:
175+
176+
```bash
177+
gh-templates gitignore preview rust
178+
```
179+
180+
2. **Backup existing** file:
181+
182+
```bash
183+
cp .gitignore .gitignore.backup
184+
```
185+
186+
3. **Update with force**:
187+
188+
```bash
189+
gh-templates gitignore add rust --force
190+
```
191+
192+
## Common Combinations
193+
194+
| Project Type | Recommended Templates |
195+
|-------------------|-----------------------------|
196+
| Rust desktop app | `rust windows macos linux` |
197+
| Python web app | `python docker vscode` |
198+
| Node.js project | `node windows macos` |
199+
| Full-stack app | `javascript python docker` |
200+
| Mobile app | `java kotlin swift xcode` |
201+
| Data science | `python jupyter r` |
202+
203+
## Troubleshooting
204+
205+
### File Already Exists
206+
207+
Without `--force`, you'll be prompted to overwrite. Options:
208+
209+
- Use `--force` to overwrite
210+
- Use `--append` to add to the existing file
211+
- Use different output name with `-o`
212+
- Manually merge the content
213+
214+
### Patterns Not Working
215+
216+
If ignore patterns aren't working:
217+
218+
1. Ensure file is named `.gitignore`
219+
2. Check file is in repository root or appropriate subdirectory
220+
3. Commit the `.gitignore` file
221+
4. Use `git rm --cached <file>` to untrack already-tracked files
222+
223+
## Tips
224+
225+
1. **Start Early**: Add `.gitignore` before committing code
226+
2. **Be Specific**: Choose templates that match your actual tech stack
227+
3. **Review Content**: Preview templates to understand what they ignore
228+
4. **Combine Wisely**: Don't add unnecessary templates that create noise
229+
5. **Update Regularly**: Refresh gitignore as your project evolves

0 commit comments

Comments
 (0)