Skip to content

Instantly share code, notes, and snippets.

@emaballarin
Last active April 9, 2023 23:39
Show Gist options
  • Save emaballarin/3f68b296aec4f58b33fd014dacae0a8e to your computer and use it in GitHub Desktop.
Save emaballarin/3f68b296aec4f58b33fd014dacae0a8e to your computer and use it in GitHub Desktop.
Simple .git/config for multiple remotes (e.g. sourcehut/github)
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[remote "sh"]
url = [email protected]:~emaballarin/__REPO_NAME__
fetch = +refs/heads/*:refs/remotes/sh/*
pushurl = [email protected]:~emaballarin/__REPO_NAME__
[remote "gh"]
url = [email protected]:emaballarin/__REPO_NAME__.git
fetch = +refs/heads/*:refs/remotes/gh/*
pushurl = [email protected]:emaballarin/__REPO_NAME__.git
[remote "all"]
url = [email protected]:~emaballarin/__REPO_NAME__
fetch = +refs/heads/*:refs/remotes/all/*
pushurl = [email protected]:~emaballarin/__REPO_NAME__
pushurl = [email protected]:emaballarin/__REPO_NAME__.git
[branch "main"]
remote = all
merge = refs/heads/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment