1

I am beyond new to GIT, and infact have set it up almost like SVN (my comfort zone). There is a "single" remote repository which we are both pushing and pulling changes from off of a single master branch. I pushed a number of changes, which I then pulled into a fourth location (production server) so I know my changes made it to the "single" remote repository.

My git push yields "everything up-to-date" message.

How do I go about debugging the situation. I assume the issue is on his end, but i don't even know how to guide him on the investigation. Nor can I find any source of logging.

Any help on an approach to diagnosing the problem would be appreciated.

Thank you

akaphenom
  • 6,728
  • 10
  • 59
  • 109

2 Answers2

0

First, you need to make sure you have pushed what you want.
check the output of:

  • git branch -avv (to see if you have an active branch, or if you are in detached HEAD mode)
  • git log (to check the last most recent SHA1 on your branch)
  • git ls-remote origin (to see if that same SHA1 has indeed been pushed)

Then you can repeat those checks on the production side, to see why a git pull wouldn't fetch and merge that most recent SHA1 that you have pushed.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Here's my 2 cents :

Say you have two branches with the following commits (IN NO ORDER, but from left to right):

person   1 2 3 4 5 6 7 8

Master   1 2 3 4 5 6 9

Now, when the guy in person branch tries to pull master, git finds that there is a commit in branch which Master does not have. The pull is essentially a merge of the two branches. In this case, the guy at person branch can do :

git reset --soft HEAD~2
git pull origin Master
git add ##### Whatever Files #####
git commit -m "10" 
git push origin person

What he just did is that he reset commit numbers 7 and 8, but kept the code that had been changed as a result of them. He is not at the same commit level as master and can hence pull in number 9. He can push the changes back now. the person branch is now :

person   1 2 3 4 5 6 9 10

Or, he could also reset and then stash his changes and then apply the stash.

Now, it so happens that at times, a user may find his remote to be different from the place he is pulling from. In that case, simply check git remove -v and if necessary, change it to the correct link from where you cloned git remote set-url origin git://new.url.here

He could also be having problems fetching the correct branch. In this case, he should do :

`git fetch` 

which will pull ALL the remote branches and then do a git checkout branchName

Hope this helps.

gran_profaci
  • 8,087
  • 15
  • 66
  • 99