Help! My git repos are in a pickle!
Pushing and pulling local and remote branches says Already up-to-date. But examining the files reveals differences between them.
This is complicated by the fact that I have two local branches, master and staging, each tracking remote versions of the same.
I’ve spent a few hours trying to work out a systematic way to sort this out. But I’m worried I’m going to make it worse and lose edits in the process.
Is there a recommended approach in these cases?
EDIT
->git remote show origin
* remote origin
Fetch URL: git@github.com:mygits/myrepo.git
Push URL: git@github.com:mygits/myrepo.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
master
staging
Remote branches:
master tracked
staging tracked
Local refs configured for 'git push':
master pushes to master (up to date)
staging pushes to staging (up to date)
Your ‘git remote origin show’ indicates that master and staging are identical. So it may be no surprise that both are ‘Already up-to-date’ but it depends on what you have locally. Explore a bit with:
With these three ‘diffs’ (two shown, one more for ‘origin/staging’) you’ll have an understanding about what git thinks are the differences between the commits on your four branches.
You still have the question of differences between what is in your working directory but ‘git status’ will show you those and they are not relevant to your pushing and pulling problem. (If anything local differences will prevent pulling which you don’t indicate as the problem.)