Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Push worked, but files are not on server

I have a git set up on my HostGator shared acct, and I just made my first push. However when I look on the server the files are not there -- Push threw no errors or said anything would be wrong.

I am using an SSH type connection if that makes any difference. And I followed this guide to set up a git repo. The remote origin URL is correct as far as I can tell.

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

Server LS:

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

Git Push 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://[email protected]:xxx/home2/xxx/public_html/thehivestl.com/cyclesafestl
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.
like image 798
tbremer Avatar asked Jun 26 '13 02:06

tbremer


People also ask

Why git push is not working?

You need to use git pull and resolve the difference between your local changes and the remote changes before you can git push . There is still a commit in the remote branch initializing the repo that may not be in your local version.

Does git push push everything?

By default, git push only updates the corresponding branch on the remote. So, if you are checked out to the main branch when you execute git push , then only the main branch will be updated. It's always a good idea to use git status to see what branch you are on before pushing to the remote.

Does git push push to all branches?

No, git push only pushes commits from current local branch to remote branch that you specified in command.


1 Answers

The files are there, you just don't see them because they are embedded into the Git database. This is the difference between initializing a repository with --bare or without (see git-init man page and this page). On the server side you only see the content of your usual .git folder where you should see your project. Try to clone again the same repository in another directory, if you can retrieve your modifications then your setup is just working fine.

like image 172
Thomas Moulard Avatar answered Oct 27 '22 01:10

Thomas Moulard