1

I'm trying to update a git repository on system startup.

I called a Script from /etc/rc.local which is executed. In that script I do the following steps:

1) Enter the folder where repo was cloned to 2) Do a git pull in that folder in two different ways 1st way simple git pull > /home/user/result.txt (doesn't work) 2nd way git --git-dir=/home/pi/gitrepo/.git pull origin master > /home/user/result.txt

What do I need to do to get this working? Also tried to test if internet connection is already available with a simple wget which was successful

Thanks in advance

Bernhard
  • 4,855
  • 5
  • 39
  • 70

1 Answers1

0

I expect this to be a problem with public key authentication.Note that commands during startup are executed as root, but you've likely registered a regular user's key at github.

Solution: register a machine key at github and use that key for the pull, like described here

Community
  • 1
  • 1
hek2mgl
  • 152,036
  • 28
  • 249
  • 266
  • Yes, but you also need to register the pub key of the machine user at github. Check the first link I provided – hek2mgl Sep 04 '14 at 10:22