How can i detach my Frappe app or ERPNext from github so that bench update command only updates on the basis of the changes i have made, not from the github source?
Set the correct git remote in your repos, or pull manually, then do bench migrate
@rmehta, after removing remote upstream from the app (in my case ERPNext) and running bench migrate, i have run bench update to check what has happened. I have got this-
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 12 (delta 2), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (12/12), done.
From https://github.com/frappe/frappe
d9bb0b3..d56767a develop -> upstream/develop
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From https://github.com/frappe/bench
0c04c0d..983d205 master -> origin/master
Updating 0c04c0d..983d205
Fast-forward
install_scripts/setup_frappe.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
From https://github.com/frappe/frappe
* branch master -> FETCH_HEAD
Already up-to-date.
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Traceback (most recent call last):File "/usr/local/bin/bench", line 9, in <module>
load_entry_point('bench==0.92', 'console_scripts', 'bench')()
File "/home/reza/bench-repo/bench/cli.py", line 60, in cli
bench()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/home/reza/bench-repo/bench/cli.py", line 240, in _update
update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File "/home/reza/bench-repo/bench/cli.py", line 255, in update
pull_all_apps(bench=bench_path)
File "/home/reza/bench-repo/bench/app.py", line 88, in pull_all_apps
exec_cmd("git pull {rebase} upstream {branch}".format(rebase=rebase, branch=get_current_branch(app, bench=bench)), cwd=app_dir)
File "/home/reza/bench-repo/bench/utils.py", line 104, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull upstream master
Does it means i have successfully detached my app (ERPNext) from github?
bench update
always pulls from upstream. So, maybe you can set your fork to upstream
@pdvyas Ohh, thank you very much for the valuable suggestion. Now my app is going to be updated from my private repo and bench will be updated from frappe as usual.
I am beginner, so just asking, is it enough to keep bench being updated from frappe and only my app detached if i am going to develop an independent app using frappe ?
yup, this is great for your own frappe app. I’d suggest not forking erpnext as it’s fast moving with high frequency of updates. Check out Not Found and custom scripts to customize ERPNext.