181 lines
4.3 KiB
Markdown
181 lines
4.3 KiB
Markdown
# Clone and Edit Locally
|
|
|
|
Ready to work on your own computer? This guide will show you how to download the entire project and make changes using proper development tools.
|
|
|
|
## Why Work Locally?
|
|
|
|
Working on your own computer gives you:
|
|
|
|
- **Faster editing** with better text editors
|
|
- **Offline work** capability
|
|
- **Better tools** for handling images and complex changes
|
|
- **More control** over your development environment
|
|
|
|
## What You'll Need
|
|
|
|
Before starting, install these free tools:
|
|
|
|
### Step 1: Install Git
|
|
|
|
1. Go to [git-scm.com](https://git-scm.com)
|
|
2. Download Git for your operating system
|
|
3. Install with default settings
|
|
4. Open a terminal/command prompt and type `git --version` to verify
|
|
|
|
### Step 2: Install a Text Editor
|
|
Choose one of these beginner-friendly options:
|
|
|
|
- **VS Code** (recommended) - [code.visualstudio.com](https://code.visualstudio.com)
|
|
- **Atom** - [atom.io](https://atom.io)
|
|
- **Sublime Text** - [sublimetext.com](https://sublimetext.com)
|
|
|
|
### Step 3: Set Up Git
|
|
Open a terminal/command prompt and run these commands (replace with your info):
|
|
|
|
```bash
|
|
git config --global user.name "Your Name"
|
|
git config --global user.email "your.email@example.com"
|
|
```
|
|
|
|
## Clone the Repository
|
|
|
|
### Step 1: Get the Clone URL
|
|
1. Go to our project on [git.albertademocracytaskforce.org](https://git.albertademocracytaskforce.org)
|
|
2. Click the **"Clone"** button
|
|
3. Copy the HTTPS URL (it looks like: `https://git.albertademocracytaskforce.org/username/projectname.git`)
|
|
|
|
### Step 2: Choose a Location
|
|
Decide where on your computer you want the project folder:
|
|
|
|
- Windows: `C:\Users\YourName\Documents\Projects\`
|
|
- Mac/Linux: `/Users/YourName/Documents/Projects/` or `/home/YourName/Projects/`
|
|
|
|
### Step 3: Clone the Project
|
|
Open a terminal/command prompt, navigate to your chosen location, and run:
|
|
|
|
```bash
|
|
git clone https://git.albertademocracytaskforce.org/[USERNAME]/[PROJECTNAME].git
|
|
```
|
|
|
|
This creates a folder with all the project files.
|
|
|
|
## Make Changes Locally
|
|
|
|
### Step 1: Open the Project
|
|
|
|
1. Open your text editor (VS Code, etc.)
|
|
2. Open the project folder you just cloned
|
|
3. Navigate to `mkdocs/docs/` to see the website files
|
|
|
|
### Step 2: Create a New Branch
|
|
Before making changes, create a new branch:
|
|
|
|
```bash
|
|
git checkout -b my-improvement-branch
|
|
```
|
|
|
|
### Step 3: Make Your Edits
|
|
|
|
1. Edit any `.md` files in your text editor
|
|
2. Save your changes
|
|
3. Preview if possible (your editor might have Markdown preview)
|
|
|
|
### Step 4: Check Your Changes
|
|
See what files you've modified:
|
|
|
|
```bash
|
|
git status
|
|
```
|
|
|
|
See exactly what changed:
|
|
|
|
```bash
|
|
git diff
|
|
```
|
|
|
|
## Commit Your Changes
|
|
|
|
### Step 1: Add Files
|
|
Tell Git which files to include in your commit:
|
|
|
|
```bash
|
|
git add .
|
|
```
|
|
|
|
(The `.` means "add all changed files")
|
|
|
|
### Step 2: Commit
|
|
Save your changes with a descriptive message:
|
|
|
|
```bash
|
|
git commit -m "Improve FAQ section with clearer examples"
|
|
```
|
|
|
|
## Push and Create Pull Request
|
|
|
|
### Step 1: Push Your Branch
|
|
Send your changes to the server:
|
|
|
|
```bash
|
|
git push origin my-improvement-branch
|
|
```
|
|
|
|
### Step 2: Create Pull Request
|
|
|
|
1. Go to our project on Gitea
|
|
2. You'll see a notice about your new branch with a button to create a pull request
|
|
3. Click it and fill out the form
|
|
4. Submit your pull request
|
|
|
|
## Keep Your Local Copy Updated
|
|
|
|
Before starting new work, always get the latest changes:
|
|
|
|
```bash
|
|
git checkout main
|
|
git pull origin main
|
|
```
|
|
|
|
Then create a new branch for your next improvement.
|
|
|
|
## What's Next?
|
|
|
|
Now you know how to work locally! Learn about [Submitting Changes](submitting-changes.md) to master the review process.
|
|
|
|
## Video Tutorial
|
|
|
|
*[Administrator: Add a video tutorial showing the complete local development workflow from clone to pull request]*
|
|
|
|
## Quick Command Reference
|
|
|
|
```bash
|
|
# Clone a repository
|
|
git clone [URL]
|
|
|
|
# Create and switch to new branch
|
|
git checkout -b [branch-name]
|
|
|
|
# Check status
|
|
git status
|
|
|
|
# Add all changes
|
|
git add .
|
|
|
|
# Commit changes
|
|
git commit -m "Your message"
|
|
|
|
# Push branch
|
|
git push origin [branch-name]
|
|
|
|
# Get latest changes
|
|
git pull origin main
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
**"Git not recognized"?** Make sure Git is installed and restart your terminal.
|
|
|
|
**Permission denied?** You might need to set up SSH keys or use HTTPS authentication.
|
|
|
|
**Merge conflicts?** Don't panic! This happens when multiple people edit the same lines. Ask for help or check our collaboration guide.
|