1

I am aware than many questions similar to this one exist. But I have now read as many of them as I could find and tried the fixes with no success.

So, I have a project where I recently had a merge conflict while trying to push. I ended up resolving the conflict via visual studio tool for it, and pushed it.

And this gets me to the point I am currently at. My local version of the project has very different code than the stuff on origin/main

If I try to pull, check status or anything of the like, I get these outputs

PS C:\app> git pull
Already up to date.
PS C:\app> git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
PS C:\app> git add .
PS C:\app> git commit -m "am I commting anythin?"
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

I then take a look at which commit I am currently at, to see if it matches the hash in the remote repo

PS C:\app> git rev-parse HEAD
0a9a00176fc39a7417e44051d4df74785e4dae7d

Which is the same hash as the one that is the current commit on the remote.

I then find this question, and figure that I might be ahead of my remote branch in some way:

PS C:\app> git branch -vv
* main 0a9a001 [origin/main] adding simple one id get

which is exactly the same commit as the newest one on the remote.

Then in a question like this one there is someone having a local ref to origin/main which is behind. But this does not seem to be the case, since pulling has no effect.

Another possible cause could be that my local origin/main is'nt tracking it's remote counterpart properly. So I tried running:

PS C:\app> git branch --set-upstream-to origin/main
branch 'main' set up to track 'origin/main'.

This also has no effect.

I've tried a few other things, which have'nt had any effect either. So I'm really hoping someone can help me out

EDIT

I also tried running:_

PS C:\app> git remote show origin
* remote origin
  Fetch URL: https://site/_git/minetilbud-ntplus-customer-migration
  Push  URL: https://site/_git/minetilbud-ntplus-customer-migration
  HEAD branch: main
  Remote branch:
    main tracked
  Local branch configured for 'git pull':
    main merges with remote main
  Local ref configured for 'git push':
    main pushes to main (up to date)

And nothing seems out of the ordinary here either

penstiaGarse
  • 161
  • 7
  • 1
    How are you checking for code difference between local and remote? (which makes you write "*My local version of the project has very different code than the stuff on origin/main*") – Romain Valeri Oct 25 '22 at 09:40
  • I'm just looking inside the code files, there is different code in there – penstiaGarse Oct 25 '22 at 10:04
  • 3
    @penstiaGarse Looking inside _which_ code files? Are you checking out a different branch? Viewing them on a different server? Are you sure that the _other_ server doesn't have anything uncommitted? – IMSoP Oct 25 '22 at 10:08
  • 1
    `git commit` tells you that there is nothing to commit, so no new commit was made. Are the files with differences tracked by Git? – knittl Oct 25 '22 at 11:52
  • Given what you've said above, it seems most likely that you resolved the merge, committed, and pushed, and your local repository is therefore up to date with the remote repository - but whatever "remote code" you're looking at is now *out* of date with respect to both the local and remote repositories, perhaps because *it* was never updated to match. – torek Oct 25 '22 at 20:46

0 Answers0