Git Error --- Your branch is ahead of 'composer/master' by 4 commits

Looking for some help fixing a Git error that I am receiving. I think the local git repo is corrupt or has an error. How do I clear the git file and resync to Master. In the file app/Models/Device.php there are 3 extra lines added in the master branch. A git diff is below.

If I Run ./scripts/github-remove -d. It just puts the corrupt app/Models/Device.php back in place.

I just moved this from and old server to a new server I had another post about this. Server Migration Issue. Ubuntu 16.04 to 18.04. Device.php has added lines

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 1.48.1-72-gda06f1ae9a
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.2.15-0ubuntu0.18.04.1
MySQL 10.1.38-MariaDB-0ubuntu0.18.04.1
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[FAIL] The poller (Librenms2) has not completed within the last 5 minutes, check the cron job.
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX]:
You can fix this with ./scripts/github-remove
Modified Files:
app/Models/Device.php

librenms@librenms:~$ git branch

  • master

librenms@librenms:~$ git status
On branch master
Your branch is ahead of ‘composer/master’ by 4 commits.
(use “git push” to publish your local commits)

Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)

    modified:   app/Models/Device.php

no changes added to commit (use “git add” and/or “git commit -a”)

librenms@librenms:~$ git diff
diff --git a/app/Models/Device.php b/app/Models/Device.php
index f4ac992e34…8f5a0c9067 100644
— a/app/Models/Device.php
+++ b/app/Models/Device.php
@@ -586,14 +586,11 @@ class Device extends BaseModel
return $this->hasMany(‘App\Models\Storage’, ‘device_id’);
}

-<<<<<<< HEAD
-=======
public function mempools()
{
return $this->hasMany(‘App\Models\Mempool’, ‘device_id’);
}

->>>>>>> 52ea0a58b337e8740b7b1401c70277f2193abf4c
public function syslogs()
{
return $this->hasMany(‘App\Models\General\Syslog’, ‘device_id’, ‘device_id’);

librenms@librenms:~$ git checkout
M app/Models/Device.php
Your branch is ahead of ‘composer/master’ by 4 commits.
(use “git push” to publish your local commits)

I think if finally figured it out.

git fetch origin
git reset --hard origin/master

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 1.48.1-70-g2eac72d34b
DB Schema 2019_01_16_195644_add_vrf_id_and_bgpLocalAs (131)
PHP 7.2.15-0ubuntu0.18.04.1
MySQL 10.1.38-MariaDB-0ubuntu0.18.04.1
RRDTool 1.7.0
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
librenms@librenms:~$ ./daily.sh
Updating to latest codebase OK
Updating Composer packages OK
Updating SQL-Schema OK
Updating submodules OK
Cleaning up DB OK
Fetching notifications OK
Caching PeeringDB data OK
librenms@librenms:~$ git status
On branch master
Your branch is up to date with ‘composer/master’.

nothing to commit, working tree clean