Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push doesn't fail but doesn't work

Tags:

git

push

I'm using Git and I'm in front of a several problem: I can push, my coworkers can pull it, and the opposite. But the version which is on the remote is not up-to-date: if I write a TEST in the html, nobody could see it except on the local version... I thought it could come from the branch which is on the remote... isn't it ?

EDIT 1 : I'll try to be more specific: I've a private repo which is on a private server. This server is used to host the website. When i commit -> pull -> push everything works great. When my coworker do the same, it's fine. On our local version, all the changes appear like my "TEST" test. But on the server, nothing is up to date. Is it the wrong branch, on the server or something?

PS : Sorry for my english, it's not my native language.

like image 740
RVA Avatar asked Aug 11 '14 15:08

RVA


2 Answers

If you are doing a plain 'git push' you may need to do 'git push origin branchname' instead. Provided the file is committed, of course.

UPDATE: Check your .git/config file. You should have an origin specified and your branch should refer to origin. Maybe there is a mismatch.

[remote "origin"]
    url = [your github repo]
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "yourbranch"]
    remote = origin
    merge = refs/heads/yourbranch
like image 183
inquiring minds Avatar answered Oct 13 '22 12:10

inquiring minds


The question is quite unclear, but several things can go wrong.

  • You need to git commit changes first. Otherwise your changes are simply not stored (unknown to git).

  • You've committed on a special branch. In that case the commits are actually stored on the server, but not shown by default. Other users can the checkout the branch by performing

    git checkout <branch>
    

    detecting on which branch you are yourself can be done with

    git branch
    
  • You and your workers use different remote servers. You can check this by running

    git remote
    

    to generate a list of installed remotes

  • ...

like image 31
Willem Van Onsem Avatar answered Oct 13 '22 14:10

Willem Van Onsem