# I RAN BRANCHING twice with theses two dir with few operation at the end
export targetdir=gia-young-picasso-v05-2101082232
export srcdir1=gia-young-picasso-v05-add
export srcdir2=gia-young-picasso-v03-201216
## BRANCHING
for srcdir in $srcdir1 $srcdir2; do
export branch_name=dup-$srcdir
export tmp_new_dir=$srcdir'-new'
git checkout -b $branch_name
git mv $srcdir $tmp_new_dir
git commit -m "dub:$srcdir"
git checkout HEAD~ $srcdir
git checkout -
git merge --no-ff $branch_name
# ---
git mv $tmp_new_dir/*.jpg $targetdir
git commit $targetdir -m "migrated:new-branch $srcdir"
rmdir $tmp_new_dir
git commit $tmp_new_dir -m cleanup
done
Last active
January 9, 2021 04:55
-
-
Save jgwill/b000037b02f942be7796675c96bca4ce to your computer and use it in GitHub Desktop.
Branch copy-merge strategy for GIT to duplicate file that uses the same source in the repo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment