gitee

[TOC]

git 命令调试

1
2
3
4
5
6
7
8
9
# <1>
Host <git-server-FQDN> LogLevel (QUIET|FATAL|ERROR|INFO|VERBOSE|DEBUG|DEBUG1|DEBUG2|DEBUG3)

# <2>
GIT_SSH_COMMAND="ssh -vvv" git clone <REPO_SSH>
# <3>
git config core.sshCommand "ssh -v"
git pull
git push

Access denied: Cannot push code by Deploy Public Key

ssh链路复用 导致的问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

# 问题表现
$ git push -u
Access deined: Public key not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

$ ssh -T git@gitee.com
Hi Anonymous! You've successfully authenticated, but GITEE.COM does not provide shell access

# 解决
手动删除mux文件即可, 问题消失了

#配置用户名密码
git config user.name "你的gitee账号"
git config user.email "你在gitee的邮箱地址"

$git config -l

user.name=cuiwm
user.email=xcuiwm@hotmail.com


$ ssh -T git@gitee.com
Hi cuiwm! You've successfully authenticated, but GITEE.COM does not provide shell access.

SSH key

https://gitee.com/profile/sshkeys

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# https://gitee.com/help/articles/4229#article-header0


$ ssh-keygen -t rsa -C 'xxxxx@company.com' -f ~/.ssh/gitee_id_rsa

# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa


$ ssh -T git@gitee.com
The authenticity of host 'gitee.com (212.64.62.174)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitee.com,212.64.62.174' (ECDSA) to the list of known hosts.
Hi cuiwm (DeployKey)! You've successfully authenticated, but GITEE.COM does not provide shell access.
Note: Perhaps the current use is DeployKey.
Note: DeployKey only supports pull/fetch operations