[root@iZ25r8k6ifuZ git]# rpm -qa git git-1.7.1-3.el6_4.1.x86_64
[root@iZ25r8k6ifuZ ~]# useradd tesla [root@iZ25r8k6ifuZ ~]# passwd tesla
[root@iZ25r8k6ifuZ ~]# su tesla [tesla@iZ25r8k6ifuZ root]$ cd ~ [tesla@iZ25r8k6ifuZ ~]$ mkdir .ssh [tesla@iZ25r8k6ifuZ ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/tesla/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/tesla/.ssh/id_rsa. Your public key has been saved in /home/tesla/.ssh/id_rsa.pub. The key fingerprint is: 13:bf:75:ba:67:7f:0e:a0:47:7a:fe:25:bc:81:85:c3 tesla@iZ25r8k6ifuZ The key's randomart image is: +--[ RSA 2048]----+ | | | | | . | | o . . | | S . E o | | . O | | + = = .| | + .o.| | o+oo+| +-----------------+ [tesla@iZ25r8k6ifuZ ~]$ cd .ssh/ [tesla@iZ25r8k6ifuZ .ssh]$ cat id_rsa.pub >> ~/.ssh/authorized_keys exit
[root@iZ25r8k6ifuZ ~]# visudo
root ALL=(ALL) ALL
tesla ALL=(ALL) ALL
[root@iZ25r8k6ifuZ ~]# mkdir /teslaRepo [root@iZ25r8k6ifuZ ~]# cd /teslaRepo/ [root@iZ25r8k6ifuZ teslaRepo]# sudo mkdir teslaProject.git [root@iZ25r8k6ifuZ teslaRepo]# chown tesla:tesla /teslaRepo/ [root@iZ25r8k6ifuZ teslaRepo]# chown -R tesla:git /teslaRepo/ [root@iZ25r8k6ifuZ teslaRepo]# cd teslaProject.git/ [root@iZ25r8k6ifuZ teslaProject.git]# sudo git --bare init Initialized empty Git repository in /teslaRepo/teslaProject.git/
localhost:~ okay$ cd Desktop/git/ localhost:git okay$ mkdir teslaRepo localhost:git okay$ cd teslaRepo/ localhost:teslaRepo okay$ git init Initialized empty Git repository in /Users/okay/Desktop/git/teslaRepo/.git/ localhost:teslaRepo okay$ git remote add origin tesla@123.57.159.74:/teslaRepo/teslaProject.git
localhost:teslaRepo okay$ touch a.txt localhost:teslaRepo okay$ git add a.txt localhost:teslaRepo okay$ git commit -m "init commit" [master (root-commit) d14cd3b] init commit 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 a.txt
localhost:teslaRepo okay$ git push origin master tesla@123.57.159.74's password: Counting objects: 3, done. Writing objects: 100% (3/3), 202 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To tesla@123.57.159.74:/teslaRepo/teslaProject.git * [new branch] master -> master
localhost:git okay$ mkdir ttt localhost:git okay$ cd ttt localhost:ttt okay$ git clone tesla@123.57.159.74:/teslaRepo/teslaProject.git Cloning into 'teslaProject'... tesla@123.57.159.74's password: remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. Checking connectivity... done.
cut -d: -f1 /etc/group
cut -d: -f1 /etc/passwd
git clone git@your_gitServer_ip:/home/gitrepo/sample.git
// 以master分支示范 git checkout master git remote rm origin git remote add origin git@your_gitServer_ip:/home/gitrepo/sample.git git push -u origin master
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有