So far i only used GIT to version control my local files, i am now trying to set up a staging environment on a remote server so that later i can push my local development files to the staging server using GIT and eventually to a production server.
So what i did was:
-
initallizaed a bare git repository on my staging server
-
Added that server as a remove on my local version of the site
-
Then ran :
git push origin master
I get no error message yet the staging repo is empty, well only the .git folder got updated but the actual files didn’t follow.
I found a similar question here Git: Files pushed from local repo not showing up in remote git repo, though i still don’t get what i am supposed to do to push my local files?
What would be the proper way to go to achieve this setup ?
Thanks
Ok so here is what i got so far.
Pushing a git repo to a remote server does not upload the actual files but rather the “blueprint” of these. So once a repo has been uploaded to a remote server, to be able to work on these files you need to clone that repo. After that the workflow is:
1-
Pushthe files from local to remote repo (central sort of repo)2- Cloned instances can
pullthe changes from that repo to stay up to date.If i got that wrong please correct me.