Skip to content

Instantly share code, notes, and snippets.

View whizkydee's full-sized avatar
🏠
Working from home

Olaolu Olawuyi whizkydee

🏠
Working from home
View GitHub Profile
@whizkydee
whizkydee / git-pushing-multiple.rst
Created September 2, 2019 19:16 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

{
"compilerOptions": {
"target": "esnext",
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules"]
}
export function isWithinOrigin(url: any, origin: string) {
try {
const {origin: derivedOrigin} = new URL(url);
if (derivedOrigin === origin) {
return true;
}
return false;
} catch {
return false;
}