Yes, sorry. Forget to add “git status”
git status
Initial commit
Untracked files:
(use “git add …” to include in what will be committed)
.codeclimate.yml
.editorconfig
.env.example
.github/
.gitignore
.mention-bot
.scrutinizer.yml
.travis.yml
AUTHORS.md
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.txt
LibreNMS/
Makefile
README.md
addhost.php
adduser.php
alerts.php
app/
artisan
billing-calculate.php
bootstrap/
build-base.php
build.sql
cache/
check-services.php
composer.json
composer.lock
config.php.default
config/
config_to_json.php
contrib/
cronic
daily.php
daily.sh
database/
delhost.php
discovery-wrapper.py
discovery.php
dist-pollers.php
doc/
html/
includes/
irc.php
librenms-service.py
librenms.cron
librenms.nonroot.cron
licenses/
lnms
logs/
mibs/
misc/
mkdocs.yml
package.json
pbin.sh
phpunit.xml
ping.php
poll-billing.php
poller-service.py
poller-wrapper.py
poller.php
readmegen.yml
renamehost.php
requirements.txt
resources/
routes/
rrd/
scripts/
server.php
services-wrapper.py
snmp-scan.py
snmp.conf.example
snmpd.conf.example
snmptrap.php
sql-schema/
storage/
syslog.php
tests/
validate.php
webpack.mix.js
nothing added to commit but untracked files present (use “git add” to track)
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.
Although after what you have done to your local git, you may be past that now and need more specific help.
git checkout master
git status
2 Likes
No luck…
-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.
-bash-4.2$ git fetch
-bash-4.2$ git reset --hard origin/master
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.
-bash-4.2$ git checkout master
warning: ignoring broken ref refs/heads/master.
error: pathspec ‘master’ did not match any file(s) known to git.
I think that this is for Debian. I have a CentOS, running nginx, PHP 7.2
LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
Version - Wed Dec 31 1969 21:00:00 GMT-0300
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
Web Server nginx/1.12.2
PHP 7.2.14
MySQL 5.5.60-MariaDB
RRDtool 1.6.0
Why are you trying to run git init? Don’t do that.
Just post info from the following commands:
git status
git remote -v
git status on the attached file, couldn’t pastebin the output:
https://drive.google.com/open?id=1aK-4Di0cqsbAdZBAt5_Moa0rFLwhoHe-
And:
-bash-4.2$ git remove -v
git: ‘remove’ is not a git command. See ‘git --help’.
Did you mean this?
remote
You have completely re-initialized the git repository… To fix it:
git remote add origin https://github.com/librenms/librenms.git
- or origin exists -
git remote origin set-url https://github.com/librenms/librenms.git
git fetch origin
git checkout master
git reset --hard origin/master
And whatever you did before don’t do that again. And for others not in the exact situation as the OP, don’t run the above commands.
Hi Murrant,
No luck:
git remote add origin https://github.com/librenms/librenms.git
fatal: remote origin already exists.
git remote origin set-url https://github.com/librenms/librenms.git
error: Unknown subcommand: origin
Of course I will not touch that. Didn’t change anythin by hand until get git first error.
Thanks!
I swapped two of the arguments around:
git remote set-url origin https://github.com/librenms/librenms.git
Thanks Murrant, git command run ok.
Then ./daily.sh failed, as it is showed below.
-bash-4.2$ git remote set-url origin https://github.com/librenms/librenms.git
-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 <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
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 <command> [<revision>...] -- [<file>...]'
Updated from unset to OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
You didn’t do the other commands after that one:
git fetch origin
git checkout master
git reset
Well, “git checkout master” doesn’t worked.
-bash-4.2$ git fetch origin
-bash-4.2$ git checkout master
warning: ignoring broken ref refs/heads/master.
error: pathspec 'master' did not match any file(s) known to git.
-bash-4.2$ git reset
Try git checkout -t origin/master
-bash-4.2$ git checkout -t origin/master
error: The following untracked working tree files would be overwritten by checkout:
.codeclimate.yml
.editorconfig
.env.example
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE/New-Device.md
.github/PULL_REQUEST_TEMPLATE.md
.github/ci-reporter.yml
.github/label-actions.yml
.github/lock.yml
.github/no-response.yml
.github/stale.yml
.gitignore
.mention-bot
.scrutinizer.yml
.travis.yml
AUTHORS.md
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE.txt
LibreNMS/Alert/AlertData.php
LibreNMS/Alert/AlertUtil.php
LibreNMS/Alert/Template.php
LibreNMS/Alert/Transport.php
LibreNMS/Alert/Transport/Alerta.php
LibreNMS/Alert/Transport/Alertmanager.php
LibreNMS/Alert/Transport/Api.php
LibreNMS/Alert/Transport/Boxcar.php
LibreNMS/Alert/Transport/Canopsis.php
LibreNMS/Alert/Transport/Ciscospark.php
LibreNMS/Alert/Transport/Clickatell.php
LibreNMS/Alert/Transport/Discord.php
LibreNMS/Alert/Transport/Dummy.php
LibreNMS/Alert/Transport/Elasticsearch.php
LibreNMS/Alert/Transport/Gitlab.php
LibreNMS/Alert/Transport/Hipchat.php
LibreNMS/Alert/Transport/Hue.php
LibreNMS/Alert/Transport/Irc.php
LibreNMS/Alert/Transport/Jira.php
LibreNMS/Alert/Transport/Kayako.php
LibreNMS/Alert/Transport/Mail.php
LibreNMS/Alert/Transport/Mattermost.php
LibreNMS/Alert/Transport/Msteams.php
LibreNMS/Alert/Transport/Nagios.php
LibreNMS/Alert/Transport/Opsgenie.php
LibreNMS/Alert/Transport/Osticket.php
LibreNMS/Alert/Transport/Pagerduty.php
LibreNMS/Alert/Transport/Playsms.php
LibreNMS/Alert/Transport/Pushbullet.php
LibreNMS/Alert/Transport/Pushover.php
LibreNMS/Alert/Transport/Rocket.php
LibreNMS/Alert/Transport/Slack.php
LibreNMS/Alert/Transport/Smseagle.php
LibreNMS/Alert/Transport/Smsfeedback.php
LibreNMS/Alert/Transport/Syslog.php
LibreNMS/Alert/Transport/Telegram.php
LibreNMS/Alert/Transport/Twilio.php
LibreNMS/Alert/Transport/Victorops.php
LibreNMS/Alerting/QueryBuilderFilter.php
LibreNMS/Alerting/QueryBuilderParser.php
LibreNMS/Authentication/ADAuthorizationAuthorizer.php
LibreNMS/Authentication/ActiveDirectoryAuthorizer.php
LibreNMS/Authentication/ActiveDirectoryCommon.php
LibreNMS/Authentication/AuthorizerBase.php
LibreNMS/Authentication/HttpAuthAuthorizer.php
LibreNMS/Authentication/LdapAuthorizationAuthorizer.php
LibreNMS/Authentication/LdapAuthorizer.php
LibreNMS/Authentication/LdapSessionCache.php
LibreNMS/Authentication/LegacyAuth.php
LibreNMS/Authentication/MysqlAuthorizer.php
LibreNMS/Authentication/RadiusAuthorizer.php
LibreNMS/Authentication/SSOAuthorizer.php
LibreNMS/Authentication/TwoFactor.php
LibreNMS/Authentication/UserProxy.php
LibreNMS/Component.php
LibreNMS/ComposerHelper.php
LibreNMS/Config.php
LibreNMS/DB/Eloquent.php
LibreNMS/DB/Schema.php
LibreNMS/Device/Processor.php
LibreNMS/Device/Sensor.php
LibreNMS/Device/WirelessSensor.php
LibreNMS/Device/YamlDiscovery.php
LibreNMS/Exceptions/ApiException.php
LibreNMS/Exceptions/AuthenticationException.php
LibreNMS/Exceptions/DatabaseConnectException.php
LibreNMS/Exceptions/FileExistsException.php
LibreNMS/Exceptions/FileNotFoundException.php
LibreNMS/Exceptions/HostExistsException.php
LibreNMS/Exceptions/HostIpExistsException.php
LibreNMS/Exceptions/HostUnreachableException.php
LibreNMS/Exceptions/HostUnreachablePingException.php
LibreNMS/Exceptions/HostUnreachableSnmpException.php
LibreNMS/Exceptions/InvalidIpException.php
LibreNMS/Exceptions/InvalidModuleException.php
LibreNMS/Exceptions/InvalidPortAssocModeException.php
LibreNMS/Exceptions/InvalidRrdTypeException.php
LibreNMS/Exceptions/JsonAppBlankJsonException.php
LibreNMS/Exceptions/JsonAppException.php
LibreNMS/Exceptions/JsonAppExtendErroredException.php
LibreNMS/Exceptions/JsonAppMissingKeysException.php
LibreNMS/Exceptions/JsonAppParsingFailedException.php
LibreNMS/Exceptions/JsonAppPollingFailedException.php
LibreNMS/Exceptions/JsonAppWrongVersionException.php
LibreNMS/Exceptions/LockException.php
LibreNMS/Exceptions/SnmpVersionUnsupportedException.php
LibreNMS/IRCBot.php
LibreNMS/Interfaces/Alert/Transport.php
LibreNMS/Interface
Aborting
-bash-4.2$ git pull origin master
fatal: No such ref: HEAD
From https://github.com/librenms/librenms
* branch master -> FETCH_HEAD
error: unable to resolve reference HEAD: No such file or directory
fatal: Cannot lock the ref 'HEAD'.
git gc --prune=now
git remote prune origin
git pull
Run out of disk space on this server previously? Your git is corrupted
We should be able to repair it.