Skip to content

Instantly share code, notes, and snippets.

View mikealche's full-sized avatar

Mike Alche mikealche

View GitHub Profile
@mikealche
mikealche / gist:af005cc99afd675731e802a2f09f6df4
Created July 6, 2025 19:01
Check out a git repo from its origins and step through it's updates
#!/bin/bash
# Git Stepper - Navigate through commits chronologically
# Usage: ./git-stepper.sh
# Get all commits in reverse chronological order (oldest first)
commits=($(git log --reverse --pretty=format:"%H"))
total_commits=${#commits[@]}
if [ $total_commits -eq 0 ]; then

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.