Daily Update error - GIT

Already try LibreNMS help with no luck…

Here is the output.


git reset --hard
-bash-4.2$ ./daily.sh
fatal: ambiguous argument ‘HEAD’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’
fatal: ambiguous argument ‘HEAD’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’
warning: ignoring broken ref refs/heads/master.
error: pathspec ‘master’ did not match any file(s) known to git.
fatal: Needed a single revision
Updating to latest codebase FAIL
fatal: No such ref: HEAD
fatal: No such ref: HEAD
You are not currently on a branch. Please specify which
branch you want to merge with. See git-pull(1) for details.

git pull <remote> <branch>

fatal: Needed a single revision
Updating Composer packages OK
fatal: ambiguous argument ‘HEAD’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’
Updated from unset to OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
-bash-4.2$ git init
Reinitialized existing Git repository in /opt/librenms/.git/
-bash-4.2$ git remote add origin https://github.com/librenms/librenms.git
fatal: remote origin already exists.
You have new mail in /var/spool/mail/librenms
-bash-4.2$ git fetch
-bash-4.2$ git reset --hard origin/master
Checking out files: 100% (9121/9121), done.
error: unable to resolve reference HEAD: No such file or directory
error: Cannot lock the ref ‘HEAD’.
-bash-4.2$ git branch --set-upstream-to=origin/master master
fatal: Failed to resolve HEAD as a valid ref.