[root@mt102 ~] /root [root@mt102 ~] root [root@mt102 ~] total 8 -rw------- 1 root root 1679 Dec 11 15:37 id_rsa -rw-r--r-- 1 root root 392 Dec 11 15:37 id_rsa.pub [root@mt102 ~] ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGiLcDnAaj2gOemJKcnlGnGmy0cb9N2uaqyuzWdPZai+blPq7Mqt4DICnRKeU0MAoeEuSM8ST01zItwrTlsPZNMKEjJ60PqAohWhHHtJuHu0sl6fs2gdrgtGtjBeqRJ9C4iRTlD3PWCqzA9M7+vZhfPzKm3QffOacTpA6k00GSep2yIpko7vcwE7YwclulaSi+RQtwxBoJVK1x3vOrCVN0y4rK4RzbO0rLYByWDARZrzCjmh5Cfjs8vs4VyYAA0t5rDEcnU/mTSjBLT79Mhlzr9b9zpT21FkDphcatJoLbMLVEo02HYs3RzxWp+mtbrwt1hCMHcOdJ328UiA0JiDX1 root@mt102 [root@mt102 ~] [root@mt102 ~] [root@mt102 ~] /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '192.168.16.101 (192.168.16.101)' can't be established. ECDSA key fingerprint is SHA256:oShRek8kc5ZO9vmSnwSPuWxKieGfPuTG8VorbWM6CiE. ECDSA key fingerprint is MD5:94:44:a1:ea:8c:c9:2b:fd:85:5e:a5:78:2d:1e:b4:53. Are you sure you want to continue connecting (yes/no)? yes /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@192.168.16.101's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@192.168.16.101'" and check to make sure that only the key(s) you wanted were added.
[root@mt102 ~] [root@mt102 ~] Last login: Fri Dec 13 23:20:42 2019 [root@mt101 ~] logout Connection to 192.168.16.101 closed. [root@mt102 ~] [root@mt102 ~] total 12 -rw------- 1 root root 1679 Dec 11 15:37 id_rsa -rw-r--r-- 1 root root 392 Dec 11 15:37 id_rsa.pub -rw-r--r-- 1 root root 176 Dec 13 23:27 known_hosts [root@mt102 ~] [root@mt102 ~] 192.168.16.101 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMtkxCPeK5boH0UWlpVYqNv3fIqsZSTj+9iW1l6XV6QHavtFg3QPpB37hAd3PIRPdOzIvwEoTWvk3vks2vzTPMI= [root@mt102 ~]
[gerrit@mt101 ~]$ [gerrit@mt101 ~]$ su - root Password: Last login: Fri Dec 13 23:27:49 CST 2019 from 192.168.16.102 on pts/1 [root@mt101 ~] [root@mt101 ~] total 12 -rw------- 1 root root 392 Dec 13 23:27 authorized_keys -rw------- 1 root root 1679 Dec 11 23:10 id_rsa -rw-r--r-- 1 root root 392 Dec 11 23:10 id_rsa.pub [root@mt101 ~] [root@mt101 ~] /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" The authenticity of host '192.168.16.102 (192.168.16.102)' can't be established. ECDSA key fingerprint is SHA256:oShRek8kc5ZO9vmSnwSPuWxKieGfPuTG8VorbWM6CiE. ECDSA key fingerprint is MD5:94:44:a1:ea:8c:c9:2b:fd:85:5e:a5:78:2d:1e:b4:53. Are you sure you want to continue connecting (yes/no)? yes /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@192.168.16.102's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@192.168.16.102'" and check to make sure that only the key(s) you wanted were added.
[root@mt101 ~] [root@mt101 ~] Last login: Fri Dec 13 23:12:23 2019 [root@mt102 ~] logout Connection to 192.168.16.102 closed. [root@mt101 ~] [root@mt101 ~] total 16 -rw------- 1 root root 392 Dec 13 23:27 authorized_keys -rw------- 1 root root 1679 Dec 11 23:10 id_rsa -rw-r--r-- 1 root root 392 Dec 11 23:10 id_rsa.pub -rw-r--r-- 1 root root 176 Dec 13 23:31 known_hosts [root@mt101 ~] [root@mt101 ~] 192.168.16.102 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMtkxCPeK5boH0UWlpVYqNv3fIqsZSTj+9iW1l6XV6QHavtFg3QPpB37hAd3PIRPdOzIvwEoTWvk3vks2vzTPMI= [root@mt101 ~]
Anliven@Anliven-PC /d/Project λ cd testrepo/ Anliven@Anliven-PC /d/Project/testrepo (master) λ echo "1234567890" >> testlog.txt Anliven@Anliven-PC /d/Project/testrepo (master) λ git add * warning: LF will be replaced by CRLF in testlog.txt. The file will have its original line endings in your working directory Anliven@Anliven-PC /d/Project/testrepo (master) λ git commit -m "update testlog" [master 6c8f1d2] update testlog 1 file changed, 1 insertion(+) Anliven@Anliven-PC /d/Project/testrepo (master) λ Anliven@Anliven-PC /d/Project/testrepo (master) λ cat testlog.txt This is the first change from local PC. 1234567890 Anliven@Anliven-PC /d/Project/testrepo (master) λ
[2019-12-14 00:02:01,017] [c17c270d] Replication to git@192.168.16.102:root/testrepo.git started... [2019-12-14 00:02:01,020] [c17c270d] Push to git@192.168.16.102:root/testrepo.git references: [RemoteRefUpdate[remoteName=refs/changes/61/61/meta, NOT_ATTEMPTED, (null)...6f1717ea24e438692c05ce9cb20255506e8167e6, srcRef=refs/changes/61/61/meta, forceUpdate, message=null], RemoteRefUpdate[remoteName=refs/heads/master, NOT_ATTEMPTED, (null)...6c8f1d20f23697d1d677ac86c30120fdd7d20c43, srcRef=refs/heads/master, forceUpdate, message=null]] [2019-12-14 00:02:22,332] [c17c270d] Replication to git@192.168.16.102:root/testrepo.git completed in 21314ms, 15003ms delay, 0 retries
7.1 问题1 - 执行git commit命令报错
问题现象:执行git commit命令时报错“git: ‘interpret-trailers’ is not a git command. See ‘git –help’.”
1 2 3 4 5 6 7
[gerrit@mt101 testrepo]$ git commit -m "a new file" git: 'interpret-trailers' is not a git command. See 'git --help'. cannot insert change-id line in .git/COMMIT_EDITMSG [gerrit@mt101 testrepo]$ [gerrit@mt101 testrepo]$ git --version git version 1.8.3.1 [gerrit@mt101 testrepo]$
Anliven@Anliven-PC /d/Project λ git clone "ssh://admin@192.168.16.101:29418/testrepo" Cloning into 'testrepo'... ssh: connect to host 192.168.16.101 port 29418: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.