Skip to content

Instantly share code, notes, and snippets.

@Drambluker
Last active May 10, 2023 14:16
Show Gist options
  • Save Drambluker/3c5b99d46d186efe379cc61d4047fd7b to your computer and use it in GitHub Desktop.
Save Drambluker/3c5b99d46d186efe379cc61d4047fd7b to your computer and use it in GitHub Desktop.
#!/bin/bash
export path_to_repo=$1
export directory_path=$2
#git remote add tmp $path_to_repo
#git fetch tmp
#git merge --allow-unrelated-histories tmp/master
#git remote remove tmp
#export tmp_dir=tmp-`uuidgen`
#git clone $path_to_repo $tmp_dir
#cd $tmp_dir
#mkdir -p $directory_path
#git mv -k * $directory_path
#git commit -m "moved to $directory_path"
#cd ..
#git remote add tmp-repo $tmp_dir
#git fetch tmp-repo
#git branch tmp-branch tmp-repo/master
#git merge tmp-branch --allow-unrelated-histories
#git branch -d tmp-branch
#git remote rm tmp-repo
#rm -rf $tmp_dir
git subtree add -P $directory_path $path_to_repo master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment