0

I have an old Synology DS-106j server where I tried to install git using ipkg command. The installation went smoothly, but git failed to work correctly. I am currently learning how to use git, so I don't know if it is a bug from git with the version I am using or something else is wrong.

What I did was create a new local repository with a specified name, add a new file, commit it, and got an error:

   NAS_SERVER> git init Test
   Initialized empty Git repository in /root/Test/.git/
   NAS_SERVER> ls
   Packages.gz                git_1.8.4.2-1_powerpc.ipk
   Test
   NAS_SERVER> cd Test
   NAS_SERVER> git status
   # On branch master
   #
   # Initial commit
   #
   nothing to commit (create/copy files and use "git add" to track)
   NAS_SERVER> touch Test.cs
   NAS_SERVER> ls
   Test.cs
   NAS_SERVER> git add *
   NAS_SERVER> git status
   # On branch master
   #
   # Initial commit
   #
   # Changes to be committed:
   #   (use "git rm --cached <file>..." to unstage)
   #
   #       new file:   Test.cs
   #
   NAS_SERVER> git commit -m "Test"
   fatal: 57e2b8c52efba71d84c56bf6f37581686b9061a3 is not a valid object

I thought...maybe I did something wrong, so I used git on Windows OS and try a push. Still an error. Transfer the whole repository to the server and check the status. It seems fine. Try a commit. Still the same result. What worse is that I can't update git version without having to compile it, which I don't even know how to do so. Any suggestion to what might be wrong?

Ice Drake
  • 89
  • 1
  • 13

1 Answers1

1

If your goal is to push into a git repo located on the synology disk(s) for backup purposes I'd recommend a different approach which would avoid having to install a rather old git version on the synology box itself (which could lead to problems if/when using a newer git version on the windows machine).

Export a samba share from synology, mount it on windows and use the windows git to create the backup repo (maybe even a bare repo, eventually group shared if you plan to share work with other people). Then push from your working repo into this backup repo - all on the windows box. In this scenario the synology box doesn't need git installed, it just serves files (i.e. its original job).

I'm using such setup but with a linux machine instead of a windows one and with the bare repo on the synology disks exported via NFS instead of Samba.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • Again, I am not quite familiar with git yet, but what I want is to have a git repo on Synology server, so it can be shared by other users outside the local network via SSH. I think that just having a shared folder and access via SSH to that folder to update doesn't achieve that purpose. Please correct me if I am wrong. – Ice Drake Apr 30 '15 at 03:26
  • For external access you'd need a SSH port open on your router redirected to a machine serving the data. Which can be any machine in your network, not only the synology box. The only advantage that synology would offer is that it's always on, using another machine would require bringing that machine on as well whenever external access is needed (or keeping it on all the time). – Dan Cornilescu Apr 30 '15 at 10:36
  • I finally understand your answer now. After googling for more info online, I was able to setup what you recommended earlier. I mainly needed to: (1)enable WebDAV, (2)create a bare repository, (3)copy it to the Synology disk, (4)use NetDrive to access the repository remotely, (5)clone repository from it, and (6)commit new changes to the repository and push it back to the Synology disk. – Ice Drake May 07 '15 at 02:52