Bench update error: Bench.utils.CommandFailedError: git pull

How can i fix this… Would someone help me how to fix this bug…

frappe@server: ~frappe-bench$ bench update
INFO: bench.utils:updating bench
INFO:bench.utils:git pull
Updating 94d346c…b77434b
error: Your local changes to the following files would be overwritten by merge:
MANIFEST.in
bench/init.py
bench/config/redis.py
bench/package.json
bench/patches/patches.txt
playbooks/develop/includes/setup_bench.yml
playbooks/develop/includes/setup_erpnext.yml
playbooks/develop/install.yml
playbooks/prerequisites/roles/nginx/tasks/main.yml
playbooks/production/includes/seup_bench_production.yml
playbooks/production/includes/setup_inputrc.yml
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/.bench/bench/utils.py”, line 256, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/.bench/bench/utils.py”, line 140, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

Please i really need help… Thanks

First of all on terminal:

  1. Go to your frappe bench path.
  2. Do cd apps/frappe/
  3. Enter command git status here. Here you will see the changes on frappe. Then enter command to stash the changes.
  4. Follow same with erpnext as well to check the changes and stash them.

i already did … when i ran git status but still it just ask these:

git config --global user.email “your_email”
git config --global user.name “your_name”

what should i do next??

Set user email and user name in git config.

e.g.

git config --global user.email xyz@gmail.com

git config --global user.name XYZ

already did that… whats next?? still wont work for me… :frowning:

sudo chown -R frappe:frappe /home/frappe/.bench
sudo chown -R frappe:frappe /home/frappe/frappe-bench
cd /home/frappe/.bench
git reset --hard
git pull
cd /home/frappe/frappe-bench
bench update

This resolved the issue.

Thanks for helping…

2 Likes