|
[root@node1 ~]# useradd -d /opt/gitServer gitServer
[root@node1 ~]# echo "gitServer" |passwd --stdin gitServer
更改用户 gitServer 的密码 。
passwd: 所有的身份验证令牌已经成功更新。
[root@node1 ~]# su - gitServer
[root@node1 ~]# git clone gitServer@192.168.100.128:/opt/gitServer/TestProject.git
Initialized empty Git repository in /root/TestProject/.git/
The authenticity of host '192.168.100.128 (192.168.100.128)' can't be established.
RSA key fingerprint is 9f:32:3a:b0:db:03:b6:c8:fc:a0:47:6c:e5:d1:b0:6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.128' (RSA) to the list of known hosts.
gitServer@192.168.100.128's password:
warning: You appear to have cloned an empty repository.
[root@node1 ~]# ls
anaconda-ks.cfg install.log install.log.syslog TestProject
[root@node1 ~]# cd TestProject/
[root@node1 TestProject]# echo "test file" > test.file
[root@node1 TestProject]# git add test.file
[root@node1 TestProject]# git config --global user.name "gitServer"
[root@node1 TestProject]# git config --global user.email git@lansgg.com
[root@node1 TestProject]# git commit -m "test commit" test.file
[master 96bf273] test commit
1 files changed, 1 insertions(+), 1 deletions(-)
[gitServer@node1 TestProject]$ git remote add test_remote_origin ssh://192.168.100.128/opt/gitServer/TestProject.git
[gitServer@node1 TestProject]$ git push test_remote_origin master
gitServer@192.168.100.128's password:
Counting objects: 5, done.
Writing objects: 100% (3/3), 252 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://192.168.100.128/opt/gitServer/TestProject.git
7e2e4a4..96bf273 master -> master
|
|
|