Git Push worked, but the files are not on the server

I have git installed on my shared HostGator host and I just made my first click. However, when I look at the server, there are no files there - Push made no mistakes or said that something would be wrong.

I use an SSH connection if that matters. And I followed this guide to set up the git repository. As far as I can tell, the remote source url is correct.

Local LS:

/Applications/MAMP/htdocs/cyclesafestl [master] $ ls /Applications/MAMP/htdocs/cyclesafestl total 32 -rw-r--r--@ 1 503 80 81 Jun 19 10:49 BETA.txt -rw-r--r-- 1 503 80 1772 Jun 18 23:11 index.php -rw-r--r--@ 1 503 80 616 Jun 18 22:49 info.txt drwxr-xr-x 7 503 80 238 Jun 17 22:59 includes/ -rw-r--r-- 1 503 80 76 Jun 17 16:18 README.md 

LS Server:

 ./ ../ HEAD branches/ config description hooks/ info/ objects/ refs/ 

Git Click Info:

 /Applications/MAMP/htdocs/cyclesafestl [master] $ git push -u origin master Counting objects: 45, done. Delta compression using up to 8 threads. Compressing objects: 100% (45/45), done. Writing objects: 100% (45/45), 498.12 KiB, done. Total 45 (delta 1), reused 0 (delta 0) To ssh:// xxx@thehivestl.com :xxx/home2/xxx/public_html/thehivestl.com/cyclesafestl * [new branch] master -> master Branch master set up to track remote branch master from origin. 
+4
source share
2 answers

There are files, you just don’t see them, because they are built into the Git database. This is the difference between initializing the repository with or without --bare (see the git -init man page and this page ). On the server side, you will see only the contents of the usual .git folder where you should see your project. Try cloning the same repository in another directory again, if you can get your changes, then your setup works fine.

+5
source

After completion of pressing. Run one of the following commands on the remote server,

 git reset --hard 

or

 git stash 
0
source

Source: https://habr.com/ru/post/1488194/


All Articles