Helping in configuring git


Can someone help me in configure git in the below file, so I can update without error?
I have travel branch (erpnext branch) and I need this branch to be updated from my github path and not official erpnext path, currently when I do bench update --reset, I am getting error.
Below the details:

config file at .git directory:

repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote “upstream”]
url = GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
fetch = +refs/heads/:refs/remotes/upstream/
[branch “master”]
remote = upstream
merge = refs/heads/master
[remote “origin”]
url = GitHub - bghayad/erpnext: Open Source ERP built for the web
fetch = +refs/heads/:refs/remotes/origin/
[branch “travel”]
remote = origin
merge = refs/heads/travel

And I am getting this error when doing bench update --reset:

Requirement already satisfied: Pillow in ./env/lib/python3.6/site-packages (6.0.0)
Backing up sites… frappe
INFO:bench.utils:git fetch --all
Fetching upstream
INFO:bench.utils:git reset --hard upstream/master
HEAD is now at 513621a02 Merge branch ‘hotfix’
INFO:bench.utils:find . -name “*.pyc” -delete erpnext
INFO:bench.utils:git fetch --all
Fetching upstream
Fetching origin
INFO:bench.utils:git reset --hard upstream/travel
fatal: ambiguous argument ‘upstream/travel’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’
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/”, line 40, in cli
File “/usr/local/lib/python2.7/dist-packages/click/”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/”, line 60, in update
_update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/.bench/bench/commands/”, line 80, in _update
pull_all_apps(bench_path=bench_path, reset=reset)
File “/home/frappe/.bench/bench/”, line 246, in pull_all_apps
remote=remote, branch=get_current_branch(app,bench_path=bench_path)), cwd=app_dir)
File “/home/frappe/.bench/bench/”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git reset --hard upstream/travel

I know that there is not travel branch at upstream, and actually travel branch existed in the origin. So why it is trying to reach it in the upstream?
Can someone help me?


OK, I discovered my problem that is happening because I am trying to do bench update while the active branch is travel and not master.

I would like to know if it possible using bench update to do update for certain branches only and certain applications only?


1 Like

Any solution? It seems that “bench update” will PULL for every single branch we have in our local dev env.