Created
July 6, 2023 08:09
-
-
Save clydet/9887c928fc51f0d947c578428a32c5a4 to your computer and use it in GitHub Desktop.
A script to automate the merge of main branch changes to other branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GITHUB_DOMAIN='https://github.com' | |
GITHUB_ORG='ZagaUS' | |
TARGET_CODEBASE=$1 | |
# clone given code base | |
function cloneCodebase() { | |
local codebase=$1 | |
local github_url="${GITHUB_DOMAIN}/${GITHUB_ORG}/${codebase}" | |
git clone $github_url | |
} | |
# find all remote branches | |
function findRemoteBranches() { | |
} | |
# filter branches | |
# - what should filter criteria be? | |
function filterBranches() { | |
} | |
function backmerge() { | |
# iterate over filtered branches: | |
# - checkout branch | |
# - merge main into checked out branch | |
# - push branch to remote | |
} | |
cloneCodebase $TARGET_CODEBASE | |
findRemoteBranches | |
filterBranches | |
backmerge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment