myshellconfig/bin/git-mergedetachedheadto

9 lines
191 B
Text
Raw Permalink Normal View History

2023-03-07 00:29:40 +01:00
#!/bin/bash
DESTBRANCH=$1
git checkout -b tmp
git branch -f ${DESTBRANCH:-master} tmp
git checkout ${DESTBRANCH:-master}
git branch -d tmp
git commit -m "Merged detached head into master" .