1

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 steve@10.0.0.15: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?

Steve Medley
  • 213
  • 1
  • 3
  • 16
  • what happens if you `clone` the repository to some other location? are the changes there? how do you access the *bare repository on the server*? using `gitweb`, ssh/terminal/, ...? – umläute Oct 04 '17 at 08:14
  • Is your question answered? If so please accept it, if not provide more information in order to help us to help you – AnimiVulpis Jan 17 '18 at 18:47

1 Answers1

1

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

AnimiVulpis
  • 2,670
  • 1
  • 19
  • 27