Skip to main content

GitHub Troubleshooting and Recovery

Document: INF-111Type: Guide / SOPStatus: ApprovedOwner: Engineering OperationsVersion: 4.2.0Updated: 2026-07-17

Authentication Failedโ€‹

  • Confirm browser authentication, Git Credential Manager, or SSH is configured.
  • Do not use the GitHub account password for Git HTTPS authentication.
  • Confirm the user has access to the organization repository.
  • Remove stale cached credentials and authenticate again.

Wrong Remote Repositoryโ€‹

git remote -v git remote set-url origin https://github.com/cloudberrie-studio/cb-website.git git remote -v

Push Rejected Because Remote Has Commitsโ€‹

This often happens when the GitHub repository was initialized with a README while the local project already had history.

git pull --rebase origin main

resolve conflicts if required

git push -u origin main

Do not force push merely to bypass this condition.

Undo a Shared Commitโ€‹

git log --oneline
git revert <commit-sha>
git push

Use revert for commits already shared. Avoid rewriting shared history.

Merge Conflictโ€‹

  1. Pull the latest target branch.
  2. Open conflicted files and resolve the marked sections.
  3. Run tests.
  4. Stage resolved files.
  5. Continue the merge or rebase.
  6. Push the updated branch.

Secret Committedโ€‹

  1. Immediately revoke or rotate the exposed credential.
  2. Remove it from the working tree and add the file/pattern to .gitignore.
  3. Assess whether history cleanup is required.
  4. Use an approved history-rewriting tool only with a coordinated plan.
  5. Force all collaborators to re-clone after history rewrite.
  6. Record the incident and corrective action.

Priority: rotation comes before repository cleanup because an exposed secret may already have been copied.

Recovery Checklistโ€‹

  • Confirm repository owner and access.
  • Confirm default branch and remote URL.
  • Inspect the GitHub audit log when available.
  • Check Actions/Cloudflare deployment logs.
  • Preserve evidence before destructive recovery.
  • Document the final resolution in Lessons Learned.