Skip to content

Commit

Permalink
Add git cptob alias
Browse files Browse the repository at this point in the history
Which is another useful Gerrit alias that allows you to cherry-pick a
commit to one or more branches.
  • Loading branch information
felipecrs committed Aug 15, 2024
1 parent fb2cdf3 commit 9e122a1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions home/dot_gitconfig.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,23 @@ psfor = "!f() { \
git caane; \
git pfor "$@"; \
};f"
cptob = "!f() { \
set -ex; \
commit="${1}"; \
shift; \
\
if echo "${1}" | grep -q ^%; then \
push_opts="${1}"; \
shift; \
else \
push_opts=""; \
fi; \
\
for branch in "${@}"; do \
echo git co "${branch}"; \
echo git rr "${branch}"; \
echo git pr; \
echo git cp "${commit}"; \
echo git pfor "${branch}${push_opts}"; \
done; \
};f"

0 comments on commit 9e122a1

Please sign in to comment.