Steve Medley
Steve Medley

Reputation: 213

Pushing to remote git server

I setup an Ubuntu server with openssh and git, nothing else is on there. It is a VM on my LAN. I created a dir under home dir called sites, in there is my main site where I want to push to. Ran these commands:

mkdir -p mysite.git
cd mysite.git
git init --bare

Then from my workstation I ran:

git remote add origin [email protected]:sites/mysite.git
git push origin master

It seemed to push it with no errors, however when I browse the dirs on the git server I can't locate any of the files. Am I missing something?

Upvotes: 1

Views: 167

Answers (1)

AnimiVulpis
AnimiVulpis

Reputation: 2726

Not exactly the same question, but very similar answer: Git bare repository doesnt reflect changes made from push

TLDR: bare repositories have no files to browse (those repositories don't have a working copy)

Create a normal git repo and search for how to automatically pull after changes are pushed.

Yes, you can push to any git repository, not only bare ones.


Edit: Maybe check this answer for inspiration: https://stackoverflow.com/a/1434230/1988796

Upvotes: 1

Related Questions