0

enter image description hereSo im trying to automatically push all commits that get created with etckeeper to my Github Repository. Everytime I make a change in the /etc directory, etckeeper creates a commit. I have created a script that automatically pushed these commits to my repository. Here is the script:

#!/bin/sh

set -e
sudo git -C /etc push -u origin master

So now when I install something or manually type

sudo etckeeper commit "message"

it instantly pushes this commit. But there is one problem. Everytime it asks for my username and password. And when I just skip these or just write random stuff in it, it still pushes. So I actually don't really know why it asks me for my credentials. Can somebody help me?

So I actually don't really know why it asks me for my credentials.

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented May 22, 2024 at 15:33

1 Answer 1

0

To answer your question: why it asks me for my credentials? It's because in the script you added sudo

Can you try removing the sudo from the script and try again?

Sign up to request clarification or add additional context in comments.

2 Comments

That's most likely not going to work since /etc/ usually has files that are not readable for normal users.
@Ferdaus Zaman, I've removed sudo from the sctipt but its still asking for username and password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.