Thứ Tư, 11 tháng 6, 2014

// // 1 comment

GIT Remote Add origin - Success

Server:
Server
root@gitserver:/var/cache/git# pwd
/var/cache/git
root@gitserver:/var/cache/git# ls
haiquynhweb  htgroup.git  htpasswd.git test001  test002
root@gitserver:/var/cache/git# mkdir test003
root@gitserver:/var/cache/git# cd test003
root@gitserver:/var/cache/git/test003# git --bare init
Initialized empty Git repository in /var/cache/git/test003/
root@gitserver:/var/cache/git/test003# cd ..
root@gitserver:/var/cache/git# chown -R root:www-data /var/cache/git/test003/
root@gitserver:/var/cache/git# chmod -R g+w /var/cache/git/test003/
root@gitserver:/var/cache/git# nano /etc/apache2/sites-available/git
root@gitserver:/var/cache/git# service apache2 restart
[....] Restarting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
. ok
 
root@gitserver:/var/cache/git# more /var/cache/git/htpasswd.git
hai:$apr1$xMq21oOa$qvdydTYM5yzfhULqIsY8r1
quynh:$apr1$pFwJrpwR$ix6I0XdqAT4hWLYMN3ige/
root@gitserver:/var/cache/git# nano /var/cache/git/htgroup.git
root@gitserver:/var/cache/git# useradd -m hai
root@gitserver:/var/cache/git# passwd hai
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@gitserver:/var/cache/git# chown -R hai:www-data /var/cache/git/test003/
root@gitserver:/var/cache/git# chown -R 770 /var/cache/git/test003/

CLient:
Client
thehai@thehai-Vostro-3550:~$ cd ~/Desktop/
thehai@thehai-Vostro-3550:~/Desktop$ ls
Data~  haiquynh.co
thehai@thehai-Vostro-3550:~/Desktop$ mkdir test000003
thehai@thehai-Vostro-3550:~/Desktop$ cd test000003/
thehai@thehai-Vostro-3550:~/Desktop/test000003$ git init
Initialized empty Git repository in /home/thehai/Desktop/test000003/.git/
thehai@thehai-Vostro-3550:~/Desktop/test000003$ git remote add origin http://hai@git.haiquynh.com/test003.git/
thehai@thehai-Vostro-3550:~/Desktop/test000003$ echo "the hai truong" >> xemngay.txt
thehai@thehai-Vostro-3550:~/Desktop/test000003$ git add xemngay.txt
thehai@thehai-Vostro-3550:~/Desktop/test000003$ git commit -a -m "1 ngay tot lanh"
[master (root-commit) fdecaef] 1 ngay tot lanh
 1 file changed, 1 insertion(+)
 create mode 100644 xemngay.txt
thehai@thehai-Vostro-3550:~/Desktop/test000003$ git push origin master
Password for 'http://hai@git.haiquynh.com':
To http://hai@git.haiquynh.com/test003.git/
 * [new branch]      master -> master

1 nhận xét:

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.