Error when switch-to-develop command

erpnext/utilities/doctype/address/address.json: needs merge
error: you need to resolve your current index first
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==2.1.0', 'console_scripts', 'bench')()
  File "/home/vhrs/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  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/vhrs/bench-repo/bench/commands/update.py", line 134, in switch_to_develop
    switch_to_develop(upgrade=upgrade)
  File "/home/vhrs/bench-repo/bench/app.py", line 205, in switch_to_develop
    switch_branch('develop', apps=apps, bench=bench, upgrade=upgrade)
  File "/home/vhrs/bench-repo/bench/app.py", line 189, in switch_branch
    exec_cmd("git checkout {branch}".format(branch=branch), cwd=app_dir)
  File "/home/vhrs/bench-repo/bench/utils.py", line 100, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git checkout develop

Hi @hereabdulla,

It seems there are conflicts in the code, please resolve the conflicts and commit the code then try again
please check http://stackoverflow.com/questions/6006737/git-merge-errors for git index error.

Thanks, Makarand

If you don’t have any custom modifications to the erpnext module, you can just do a hard reset.

cd /home/frappe/frappe-bench/aps/erpnext git reset --hard

then try the switch-to-develop again.