diff options
| author | Mitja Felicijan <m@mitjafelicijan.com> | 2023-06-29 18:43:16 +0200 |
|---|---|---|
| committer | Mitja Felicijan <m@mitjafelicijan.com> | 2023-06-29 18:43:16 +0200 |
| commit | 38f16eaba2f9f6b9e36426f19c792164d6552f78 (patch) | |
| tree | 8407ab5f229363ca8c36642034a70d3dc500d83e /content/posts | |
| parent | 93d47662b2ce5a6dc4867687386c912e8cd13720 (diff) | |
| download | mitjafelicijan.com-38f16eaba2f9f6b9e36426f19c792164d6552f78.tar.gz | |
Removed post because note existed with the same content
Diffstat (limited to 'content/posts')
| -rw-r--r-- | content/posts/2023-05-10-push-to-multiple-origins-at-once-in-git.md | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/content/posts/2023-05-10-push-to-multiple-origins-at-once-in-git.md b/content/posts/2023-05-10-push-to-multiple-origins-at-once-in-git.md deleted file mode 100644 index adef7e9..0000000 --- a/content/posts/2023-05-10-push-to-multiple-origins-at-once-in-git.md +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | --- | ||
| 2 | title: Push to multiple origins at once in Git | ||
| 3 | url: push-to-multiple-origins-at-once-in-git.html | ||
| 4 | date: 2023-05-10T12:00:00+02:00 | ||
| 5 | draft: false | ||
| 6 | --- | ||
| 7 | |||
| 8 | This is a quick one. I use my personal Git server as my main server, and I use | ||
| 9 | GitHub only as a mirror. As a result, I constantly forget to push to GitHub. | ||
| 10 | |||
| 11 | To push to multiple origins at once in Git, you can create a custom Git alias or | ||
| 12 | use a script to automate the process. Here's an example of how you can achieve | ||
| 13 | this using a Git alias: | ||
| 14 | |||
| 15 | ```sh | ||
| 16 | git config --global alias.pushall '!sh -c "git remote | xargs -L1 git push --all"' | ||
| 17 | ``` | ||
| 18 | |||
| 19 | This command creates a Git alias called `pushall` which, when executed, will | ||
| 20 | push the changes to all the remote repositories associated with the current | ||
| 21 | repository. To use it, simply run `git pushall` instead of `git push` when you | ||
| 22 | want to push to all the remote repositories at once. | ||
| 23 | |||
| 24 | That's all, folks. | ||
