Synthesized from several helpful stackoverflow responses and some trial and error. This is intended for use in a development or possibly staging environment.
bench get-app cloud_storage git@github.com:agritheory/cloud_storage.git --skip-assets
This will complete the default clone/install (but not build) of a Frappe app.
Let's confirm what we're working with is a shallow clone with only the latest commit on the default branch.
cd apps/cloud_storage
git branch
# version-14
Time for surgery. Remove the existing shallow clone folder from the app's folder,
# ~/frappe-bench/apps/cloud_storage
rm -rf .git
git clone --mirror git@github.com:agritheory/cloud_storage.git .git
git config --unset core.bare
git config receive.denyCurrentBranch updateInstead
git config --unset remote.origin.mirror
git reset --hard
Confirm this worked
# now test
# should show all branches from remote
git log
# should show full commit history on default branch
Since this is focused on a development environment, it is appropriate to rename the remote from 'upstream' to 'origin'.
git remote rename upstream origin
Becasue this is based on the --mirror
flag, some extra steps to get more normal fetch/pull behaviours are required. Edit /cloudstorage/.git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@github.com:agritheory/cloud_storage.git
fetch = +refs/heads/*:refs/remotes/origin/*
[receive]
denyCurrentBranch = updateInstead
This will allow you to fetch and/or pull onto open branches.