Received disconnect from gitlab.local port 22:2: Too many authentication failures
Disconnected from gitlab.local port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git remote remove origin
git remote add origin git:user/project.git
git push -u origin master
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 6.32 KiB | 1.58 MiB/s, done.
Total 8 (delta 0), reused 0 (delta 0), pack-reused 0
remote: error executing git hook
To git:user/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git:user/project.git'
The log does not contain any hint to an error or warning
That would make the “User” entry in said config superfluous
ssh MyHost would work as well as ssh git@MyHost - why would git need the git@MyHost url?
ssh connection for my setup works, i.e. ssh git works without problems
Your link is missing the user statement in the config - thats probably why they need the “user@host” form.
So I checked your answers - they do not solve the problem.
git clone git:user/project.git
warning: You appear to have cloned an empty repository.
cd project
touch test
git add test
git commit -m test
[master (root-commit) 0265832] test
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test
git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 193 bytes | 193.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: error executing git hook
To git:user/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git:user/project.git'
The provided ssh configuration does work in fact.
If I removed the User entry of the config, git clone asks for a password for the current user
If I removed the IdentityFile entry of the config, git clone asks for a password for the user gitlab.
As the error says you have some pre-receive git hooks configured which is causing error on push.
I am not familiar with ArchLinux deployments, but you can check docs related to hooks Server hooks | GitLab
updatedb
locate -r pre-receive| grep -v sample
/usr/share/webapps/gitlab-gitaly/ruby/git-hooks/pre-receive
cat /usr/share/webapps/gitlab-gitaly/ruby/git-hooks/pre-receive
#!/bin/sh
# This is the single source of truth for where Gitaly's embedded Git hooks are.
exec "$GITALY_BIN_DIR/gitaly-hooks" "$(basename $0)" "$@"
archlinux setup differs mainly in paths and username it seems. Hooks are not mentioned in the distributions wiki article for gitlab (https://wiki.archlinux.org/index.php/GitLab)