Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Ability to pull a private repository via Git

Ability to pull a private repository via Git

Scheduled Pinned Locked Moved LAMP
3 Posts 2 Posters 553 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • FoksVHoxF Offline
    FoksVHoxF Offline
    FoksVHox
    wrote on last edited by
    #1

    Hello!

    I'd like to pull a private repository once a day, however, I currently need to retype the credentials every time. When I try to use git to store the credentials, I get the following error:

    # git config --global credential.helper cache
    error: could not lock config file /root/.gitconfig: Read-only file system
    

    Would it be possible to add a way to do this?

    girishG 1 Reply Last reply
    0
    • FoksVHoxF FoksVHox

      Hello!

      I'd like to pull a private repository once a day, however, I currently need to retype the credentials every time. When I try to use git to store the credentials, I get the following error:

      # git config --global credential.helper cache
      error: could not lock config file /root/.gitconfig: Read-only file system
      

      Would it be possible to add a way to do this?

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      @FoksVHox On Cloudron , only the /app/data (persistent, part of app backup), /run (runtime) and /tmp (temporary, auto-cleaned up) directories are writable.

      So, you have to set the credential path to somewhere in /app/data using git config credential.helper 'store --file=/app/data/git_credentials'. Important: You have to run this command in your git checkout! This is because it saves this info inside .git/config.

      For example, my repo is helloworld. Then, I cd into it and:

      root@89cc2457-9d0a-4752-affb-c918fa4a90db:/app/data/helloworld# git config credential.helper 'store --file=/app/data/git_credentials'
      
      root@89cc2457-9d0a-4752-affb-c918fa4a90db:/app/data/helloworld# git fetch
      Username for 'https://git.cloudron.space': root
      Password for 'https://root@git.cloudron.space': 
      
      root@89cc2457-9d0a-4752-affb-c918fa4a90db:/app/data/helloworld# git fetch
      

      (the second command above ends up storing it in the file /app/data/git_credentials and the third command does not ask for password anymore).

      1 Reply Last reply
      1
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        Also, to automate the pull, put this in the app's cron:

        * * * * * echo "==> Pulling" && cd /app/data/helloworld && git pull
        

        Then, in the logs, you will see:

        Mar 20 15:48:02 ==> Pulling
        Mar 20 15:48:02 From https://git.cloudron.space/root/helloworld
        Mar 20 15:48:02 8e9fa9a..6a79ead master -> origin/master
        Mar 20 15:48:02 Updating 8e9fa9a..6a79ead
        Mar 20 15:48:02 Fast-forward
        Mar 20 15:48:02 index.php | 3 ++-
        Mar 20 15:48:02 1 file changed, 2 insertions(+), 1 deletion(-)
        

        It pulls every minute for testing, so you might want to adjust the cron pattern.

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Bookmarks
        • Search