πŸ“… 2025-03-13 β€” Session: Resolved Git Deployment Issues with Hugo Site

πŸ•’ 09:25–09:50
🏷️ Labels: Git, Deployment, Hugo, Github Pages
πŸ“‚ Project: Dev
⭐ Priority: MEDIUM

Session Goal

The goal of this session was to resolve deployment issues with a Hugo site on GitHub Pages, specifically focusing on Git management and branch handling.

Key Activities

  • Undoing Accidental Push to gh-pages: Steps were taken to reset the gh-pages branch after an accidental push, including finding the last good commit and redeploying from the correct directory.
  • Assessing Repo Status & Deploying Properly: Addressed issues with branch divergence, staged and committed local changes, and reset the gh-pages worktree for proper deployment.
  • Resolving Git Merge Issues: Tackled the β€˜refusing to merge unrelated histories’ problem, providing solutions for merging and resetting branches.
  • Force Overwriting Remote Git History: Safely overwrote the remote Git repository with local files, including backup and deployment instructions.
  • Deploying a Hugo Site: Rebuilt, tested, and deployed the Hugo site to GitHub Pages, ensuring all changes were staged and tested locally.

Achievements

  • Successfully resolved Git merge and deployment issues.
  • Deployed the Hugo site to GitHub Pages without errors.

Pending Tasks

  • Monitor the deployed site for any further issues.
  • Consider automating parts of the deployment process to prevent future errors.