GitHub Repository Management

Module 1 - GIST 604B

Building Professional Portfolios Through Proper Repository Structure

Why Repository Management Matters

  • πŸ’Ό Your GitHub is Your Portfolio
    First impression for employers and collaborators
  • 🏒 Real-World Statement
    "I've hired people based on their GitHub" - Common from tech managers
  • ⏰ Time Saver
    Good documentation reduces support burden
  • πŸ™ Future-You Will Thank You
    6 months later, you'll appreciate clear organization

Repository management = Professional communication

Essential Repository Components

project-name/ β”œβ”€β”€ README.md ← Your repo's front door β”œβ”€β”€ LICENSE ← Legal foundation β”œβ”€β”€ .gitignore ← Keep it clean β”œβ”€β”€ data/ ← Sample data β”œβ”€β”€ src/ ← Source code β”œβ”€β”€ docs/ ← Documentation β”œβ”€β”€ tests/ ← Test files └── examples/ ← Usage examples

README, LICENSE, .gitignore + organized directories = Professional repository

README.md - Your Repository's Front Door

Must Include:

  • βœ… Project title and brief description
  • βœ… What problem it solves
  • βœ… How to install/use it
  • βœ… Basic examples
  • βœ… How to contribute (for public projects)
  • βœ… Contact information

πŸ”— Live Examples:
Leaflet | GDAL | GeoPandas

README Examples: Good vs Bad

❌ Bad Example:
# Project 2

My code for class

`python main.py`
                        

Too vague, no context, no explanation

βœ… Good Example:
# Earthquake Mapper

Interactive Leaflet map visualizing 
USGS earthquake data from the past 
30 days.

## Features
- Real-time data from USGS API
- Circle markers sized by magnitude
- Popup info for each earthquake

## Installation
```bash
pip install -r requirements.txt
python app.py
```

## Usage
Visit http://localhost:5000
                        

LICENSE - Legal Foundation

⚠️ Without a license = All Rights Reserved

Nobody can legally use, modify, or distribute (even if public!)

Common Choices:

  • MIT - Permissive, minimal restrictions, maximum adoption
  • GPL v3 - Copyleft, modifications must remain open
  • Apache 2.0 - Patent protection, enterprise-friendly

πŸ”— Add via GitHub: choosealicense.com

.gitignore - Keep Repositories Clean

What to Ignore:

Operating System Files:
.DS_Store
Thumbs.db
desktop.ini
IDE Configurations:
.vscode/
.idea/
*.swp
Dependencies:
node_modules/
venv/
__pycache__/
Secrets & Configs:
.env
config.local.json
*.key

πŸ”— Templates: github.com/github/gitignore

Professional Directory Structure

spatial-analysis-toolkit/ β”œβ”€β”€ README.md ← Project overview β”œβ”€β”€ LICENSE ← Legal terms β”œβ”€β”€ .gitignore ← Ignore patterns β”œβ”€β”€ requirements.txt ← Python dependencies β”œβ”€β”€ src/ ← Source code β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ spatial_utils.py β”‚ └── visualization.py β”œβ”€β”€ data/ ← Sample data β”‚ β”œβ”€β”€ README.md ← Data documentation β”‚ └── sample_points.geojson β”œβ”€β”€ docs/ ← Documentation β”‚ β”œβ”€β”€ installation.md β”‚ └── usage.md β”œβ”€β”€ tests/ ← Unit tests β”‚ └── test_spatial_utils.py └── examples/ ← Usage examples └── basic_analysis.ipynb

Consistency helps everyone (including future-you)

Markdown Basics for Documentation

Markdown:
# Heading 1
## Heading 2
### Heading 3

**bold** and *italic*

- List item 1
- List item 2

1. Numbered item
2. Another item

[Link text](url)
![Image](image-url)

```python
code block
```
Renders as:

Heading 1

Heading 2

Heading 3

bold and italic

  • List item 1
  • List item 2
  1. Numbered item
  2. Another item

Link text

code block

πŸ”— Reference: markdownguide.org

Writing Effective Documentation

  • βœ… Write for beginners
    Assume reader knows nothing about your project
  • βœ… Explain "why" not just "what"
    Context helps understanding
  • βœ… Include prerequisites
    List required software, libraries, knowledge
  • βœ… Show expected output
    Screenshots, example results, success indicators
  • βœ… Troubleshooting section
    Address common issues proactively
  • ⚠️ Keep it updated!
    Outdated docs are worse than no docs

Professional Repository Naming

βœ… Good Names:
  • spatial-analysis-toolkit
  • leaflet-earthquake-map
  • postgis-performance-benchmarks
  • qgis-plugin-template
❌ Bad Names:
  • project2 - Too generic
  • My GIS Tool - Spaces cause issues
  • FINAL_PROJECT_REALLY_FINAL - Unprofessional
  • asdf - Not descriptive

Use lowercase with hyphens: descriptive and specific

Writing Clear Commit Messages

βœ… Good Commit Messages:
Add elevation data processing function
Update README installation steps
Fix coordinate precision bug in distance calculation
Refactor spatial query logic for performance
❌ Bad Commit Messages:
fixed stuff
wip
asdf
updated files
more changes
πŸ’‘ Best Practices:
  • Present tense: "Add feature" not "Added feature"
  • Reference issues: "Fix #42" or "Closes #15"
  • Be specific and descriptive

Branching Strategy

main branch (stable, working code)
    β”‚
    β”œβ”€β”€β”€β”€ feature/add-postgis-support (new functionality)
    β”‚
    β”œβ”€β”€β”€β”€ fix/coordinate-precision (bug fixes)
    β”‚
    └──── docs/update-installation (documentation updates)
  • main = stable, production-ready code
  • feature/ = new functionality development
  • fix/ = bug fixes
  • docs/ = documentation updates

We'll dive deep into branching in Video 4

Repository Settings & Configuration

  • πŸ”“ Public vs πŸ”’ Private:
    Public for portfolio/open source, Private for proprietary/in-progress
  • πŸ“ Description & Topics:
    Help people discover your repository
  • πŸ“„ GitHub Pages:
    Host documentation, project websites
  • πŸ› Issue Templates:
    Structure for bug reports, feature requests
  • πŸ€– GitHub Actions:
    Automated testing and deployment

πŸ”— Demo: We'll explore these settings live

GitHub as Your GIS Portfolio

  • πŸ“Œ Pin Important Repositories
    Show your best work first
  • πŸ‘€ Complete Profile
    Bio, location, website, social links
  • πŸ“Š Contribution Graph
    Shows consistency and activity
  • 🏒 Organizations
    Shows collaboration and team experience
  • πŸ“ Profile README
    Create username/username repo for profile page

πŸ”— Examples: giswqs | awesome-profile

Assignment: M1A3

Create a Professional GIS Repository

  • βœ… Proper structure (README, LICENSE, .gitignore, directories)
  • βœ… Professional README with all essential components
  • βœ… Appropriate license and .gitignore
  • βœ… Simple Python GIS script (spatial "Hello World")
  • βœ… Clean commit history with good messages
  • βœ… Link from GitHub Classroom assignment
πŸ€– Automated Validation:
GitHub Actions will check your repository structure and script execution

Essential Resources

Documentation:
Great README Examples:

πŸ“š Bookmark theseβ€”you'll use them throughout your career

Key Takeaways

  • βœ… Repository management = professional communication
  • βœ… Four essential files: README, LICENSE, .gitignore, structure
  • βœ… Documentation is for others AND future-you
  • βœ… Small details create professional impression
  • βœ… Your GitHub IS your portfolio

Practice good habits now = portfolio-ready later

Ready for M1A3? Let's build professional repositories!