Skip to content

Instantly share code, notes, and snippets.

@wakita
Last active December 15, 2023 08:13
Show Gist options
  • Save wakita/1e09164924cec09650f21ef29b8fdb78 to your computer and use it in GitHub Desktop.
Save wakita/1e09164924cec09650f21ef29b8fdb78 to your computer and use it in GitHub Desktop.
git-remote-dropbox のリポジトリを作成するスクリプト

git-remote-dropox を設定するためのスクリプト

どこかに空のディレクトリを作成し、そこで new_git_repository を実行すると Dropbox git repository に空の Readme.md だけを含んだリポジトリが作成され、そこに clone される。

new_git_repository() {
here=`pwd`
repository=${here#"$DROPBOX/"}
dropbox_repo="dropbox:///.git-repository/$repository"
new_repo=/tmp/new-repo
rm -rf $new_repo; mkdir $new_repo; pushd $new_repo
git init
venv base
git remote add origin "$dropbox_repo"
touch Readme.md
git add .; git commit -m "Initial commit"
git push --set-upstream origin main
git push
popd
git clone "$dropbox_repo" .
deactivate
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment