Added tool for copying other repositories branches to this repository

This commit is contained in:
Sammy Hori
2024-10-18 23:29:39 +01:00
parent c880a2530a
commit 728ee46fa8

21
make-branch.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -euof pipefail
profilename="$1"
projectname="awesome-for-beginners"
branchname="${2:-main}"
fullname="${profilename}/${branchname}"
branchname="${fullname}-branch-copy"
git checkout main
git checkout -b "${branchname}"
git remote add "${profilename}" "https://github.com/${profilename}/awesome-for-beginners.git"
git fetch "${profilename}"
git merge --no-gpg "${fullname}" -m "Merge ${fullname} into ${branchname}"
git remote remove "${profilename}"
git fetch --prune
git push --set-upstream origin "${branchname}"
git checkout main