I've setup a remote git repo and pushed my local repo to the remote repo. This worked fine as expected, however on the remote repo, I don't see the files associated to the project, it just has branches
, config
, description
, HEAD
, etc.
Where are the actual project file for the repo?
Here's what I did:
Remote Server:
cd /var/www/directory
git --bare init
Local Project (in git repo):
git remote add remote root@IP:/var/www/directory
git push remote master
This worked, it pushed as you would expect. Just when I go to /var/www/directory
the project files aren't there, only git related files.
You have created a "bare" repo. It doesn't contain the files just information about the commits.
A "bare" repository in Git just contains the version control information and no working files (no tree) and it doesn't contain the special .git sub-directory. Instead, it contains all the contents of the .git sub-directory directly in the main directory itself.
http://bitflop.com/document/111
It looks like you want to push to deploy your changes. Rather what you should do is create a non-bare repo in your /var/www/directory
and pull from your developement repo or a bare repo. You will have a non-bare repo in your location and when you want to deploy updates you will run git pull
from the directory which will update the files. This will also allow you easily move the code to a previous version if there are major issues with the last updates using git checkout <SHA>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments