Error in ERPNext After Update

Hi,
I did update to my erpnext yesterday but after that it has been broken.
The error it shows clearly tells that I did some changes in the source code of operation.py and purchase_invoice.py, I renamed the original files and made changes in the copied file and after the error I deleted the copy and renamed the original files back. Now it says either commit.
Can anybody tell me what to do now? Below is the error I am getting:

sam@sam-VirtualBox:~/frappe-bench$ bench update --upgrade
remote: Counting objects: 58, done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 58 (delta 18), reused 10 (delta 10), pack-reused 13
Unpacking objects: 100% (58/58), done.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
87f3f36…db82701 develop → upstream/develop
Already up-to-date.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Updating 5b64952…c76e34d
    error: Your local changes to the following files would be overwritten by merge:
    erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
    erpnext/manufacturing/doctype/operation/operation.json
    Please, commit your changes or stash them before you can merge.
    Aborting
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/sam/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/sam/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/sam/bench-repo/bench/cli.py”, line 256, in update
    pull_all_apps(bench=bench_path)
    File “/home/sam/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/sam/bench-repo/bench/utils.py”, line 104, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull upstream master

There are some local changes, commit your changes and pull again.

Yes, I know that I have done change, but I don’t know how to commit these changes and and how to do a pull back.

ref http://git-scm.com/docs

git commit -all

Output: fatal: Not a git repository (or any of the parent directories): .git

  1. cd frappe-bench/app/app_name
  2. git status (shows list of newly added and modified files)
  3. git add file_path or .(to add all files)
  4. git commit -m"commit message"

then come back to frappe-bench and execute bench update

1 Like

@ruchin78. Check also this link , another discussion on this forum.

Thanks Saurabh,
It was really helpful for me.
I appreciate if you can tell me what is this:
http://git-scm.com/docs
Even, I have used the command provided by you but, I don’t have any idea about it.

Regards
Ruchin Sharma