Before
- Check every remote before push
- Rewrite
originURLs when switching accounts - Accidentally push with wrong identity
Daily Workflow Examples
These examples show how host aliases like git@github-personal:username/repo.git remove repetitive remote edits and make context switching between personal, work, and client repositories safer.
origin URLs when switching accountsClone each repository with a dedicated host alias and never touch remote URLs again.
# personal project
git clone git@github-personal:yourname/dotfiles.git
# work project
git clone git@github-work:your-org/platform-api.git
# daily usage stays normal
cd platform-api
git pull
git pushWhen you jump between client repos all day, alias-based remotes prevent repetitive fixes.
# no need for repeated remote set-url
git remote -v
# origin git@github-client-a:client-a/web-app.git
# just branch and push
git checkout -b feat/payment-audit-log
git push -u origin feat/payment-audit-log If you have website in personal and company accounts, host aliases make the target explicit and safe.
# personal website
git clone git@github-personal:yourname/website.git website-personal
# company website
git clone git@github-work:company/website.git website-workUse provider-specific aliases and keep one predictable pattern everywhere.
git clone git@github-work:team/service-api.git
git clone git@gitlab-client:client/mobile-backend.git
git clone git@bitbucket-legacy:ops/infra-scripts.gitCreate a repository and set origin once with the right identity from day one.
mkdir release-tool && cd release-tool
git init
git remote add origin git@github-work:your-org/release-tool.git
git add .
git commit -m "chore: initial scaffolding"
git push -u origin maingit remote -v, then continue normallygit config user.email per repo only when intentionally overriding