skip to Main Content

I have created a repo within cPanel, cloned it to my local computer and then added some files. Now when i push the commits back up, everything seems to work nicely. However, the cPanel filemanager shows no files in the corresponding repo except for the .git-Folder.

This is what I do in git bash:

This is what I do in git bash

This is what the cPanel filemanager shows me… nothing:

This is what the cPanel filemanager shows me... nothing

Any clues?

2

Answers


  1. Git would checkout files with content.

    You have created three empty files (touch a.txt)

    Try again, with a minimal content

    echo "test">a.txt
    git add .
    git commit -m "a with content"
    git push 
    

    Another explanation: the remote repository is a bare one (its .git/config file includes bare = true)

    Or, following git config receive.denyCurrentBranch on the server (cPanel) side: since it is set to ignore… it will allow the push but will not update the working tree.

    Login or Signup to reply.
  2. This will solve your problem for sure as i wasted my 5 hour in search for the same issue –

    1. First check the GIT VERSION on remote using ssh using command git
      –version In my case it was 2.19.1 which is this root cause for this problem.
    2. I suggest to create a new repo on cPanel before staring the below process, once you create new repo check following….
    3. Now make sure on remote config denyCurrentBranch = updateInstead below is my remote config screenshot, you can check remote config using command git config –edit when you inside remote repo directory
      My Live git config screenshot

    4. Now clone the cpanel repo on your local, and check your local git config file and make sure it has the tag [remote “origin”] [Screenshot 2 ]if you can’t find it use this command on your local
      git remote add origin ssh://username@website/home/username/reponame

    5. Now simply add any test file and commit the changes and push using below command and your remote repo will get updated 100%
      git push origin master -u –exec=/usr/local/cpanel/3rdparty/bin/git-receive-pack

    Best Of Luck 🙂

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search