I have done the following steps to detach a frappe app (in my case ERPNext) from source repository-
At first, i have moved to frappe-bench/apps/erpnext via terminal and than set remote url for that app towards a private repo i have made, by
git remote set-url origin git://my-repo.url.here
And than i run the following command to check the remote version for erpnext-
git remote -v
It shows following output-
origin https://github.com/my_git_user_name/REPOSITORY.git (fetch)
origin https://github.com/my_git_user_name/REPOSITORY.git (push)
upstream https://github.com/frappe/bench.git (fetch)
upstream https://github.com/frappe/bench.git (push)
That means, though i set my apps remote url towards my own repo, bench update command will still update the app from upstream, in my case, frappe/bench.
So i have first removed the upstream-
git remote rm upstream
And than set new upstream towards my repo-
git remote add upstream https://github.com/my_git_user_name/REPOSITORY.git
Than i have gone to bench-repo folder via terminal and run the following command to migrate the changes-
bench migrate
Now if i run bench update, i see that my app is updating from my private repo. (Though, bench will update from official repo)
These steps can be done for any frappe app.