Low-Frequency / Klipper-Git-Backup

Fully automated klipper backups
112 stars 26 forks source link

Error when initializing repo #6

Closed e1w00db1ue5 closed 2 years ago

e1w00db1ue5 commented 2 years ago

Hi,

Getting the following error; this is on a new blank repo.

Initializing repo
error: unknown option `initial-branch=main'
usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]] [<directory>]

    --template <template-directory>
                          directory from which templates will be used
    --bare                create a bare repository
    --shared[=<permissions>]
                          specify that the git repository is to be shared amongst several users
    -q, --quiet           be quiet
    --separate-git-dir <gitdir>
                          separate git dir from working tree

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git

TIA

J

Low-Frequency commented 2 years ago

Hi,

which version of git do you have installed? You can check that with git --version If it's prior to 2.28 you have to update git to make the command work.

e1w00db1ue5 commented 2 years ago

git version 2.20.1

I have completed a apt-get update / upgrade prior to using script.

This is an image running from FluiddPi

Low-Frequency commented 2 years ago

Try uninstalling git and reinstalling from the source. The commands for that are:

sudo apt remove git
sudo apt update
sudo apt install make libssl-dev libghc-zlib-dev libcurl4-gnutls-dev libexpat1-dev gettext
cd /usr/src/
sudo wget https://github.com/git/git/archive/refs/tags/v2.36.0.tar.gz -O git.tar.gz
sudo tar -xf git.tar.gz
cd git-*
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install

After that check the version again. It should be 2.36.0

e1w00db1ue5 commented 2 years ago

It's still 2.20.1, I'm starting to think that's the latest this install will permit. I've tried to add the GitHub repository but get told there's no version for my distro (**words to that effect)

Just trying compiling the latest version.

e1w00db1ue5 commented 2 years ago

Compiled latest verision of git using this guide (https://arslanmalik.medium.com/how-to-install-git-on-raspberry-pi-cdd6ee877e74)

Which has a few errors, installed your script without issues.

Appears to be working.

This was a fluidPi install, it's possible others may have a similar issue can I suggest you make a note of the required git version?

Thanks for your help.

J

Low-Frequency commented 2 years ago

That's the same guide I followed minus one copy/paste error. Whoops

Glad it worked.

I'll update the README with that info and link the guide