1

I am trying to set up a shiny server with the manual of Dean Attali. So far I made the shiny server work. This should be proofed by the fact that the "Welcome to Shiny Server" page shows up when I navigate to the server ip. The problem is that I cannot connect my shiny server to GitHub like in step 8.2 of the manual. I tried it a several times now, but I am getting this error message:

error: src refspec master does not match any.

error: failed to push some refs to 'origin'

This is my code:

sudo apt-get -y install git
cd /srv/shiny-server
git init
echo "# shiny-server" >> README.md
git commit -m "first commit"
git config --global user.email "user@user.com"
git config --global user.name "gituser"
git remote add origin git@github.com:gituser/shiny-server.git

The email address "user@user.com" and the user name "gituser" are just dummies.

I already deployed the fitting key in the repository settings in GitHub.

Hope that you can help me! Thanks in advance :)

Community
  • 1
  • 1
Felix Grossmann
  • 1,224
  • 1
  • 11
  • 30

1 Answers1

0

There is a step missing here:

git init
echo "# shiny-server" >> README.md
git commit -m "first commit"

The missing step is a git add, to add the README.md to Git.

Without the git add step, git commit did nothing. As such, the repository doesn't have any commits, and therefore there's nothing to push, resulting in the error that you observed.

This way it will work:

git init
echo "# shiny-server" >> README.md
git add --all
git commit -m "first commit"
janos
  • 120,954
  • 29
  • 226
  • 236
  • thanks for your first advice. I changed this in my code, but now I have two new errors (I edited my post). Could you help me again pls? :) – Felix Grossmann Oct 28 '16 at 21:45
  • It's not clear what you changed, and what are the "two new errors". But your update invalidates my answer: with your change my answer makes no sense now. – janos Oct 28 '16 at 21:54
  • Sorry, I am new to SO! :( Changed it again! Thanks for your help! – Felix Grossmann Oct 28 '16 at 21:59
  • @fexjoo thanks for that. If you post your new question with the new errors, I'll try to take a look (or somebody else will) – janos Oct 28 '16 at 22:00