1. 在git server端如何创建一个工程
(1) su git
(2) mkdir linux-git.git
(3) cd linux-git.git
(4) git init --bare
(5) exit
2. 在clinet端如何clone、提交代码
(1) git clone [email protected]:/home/prj_git/linux-git.git
(2) cd linux-git
(3) cp ../linux-3.18.3 ./ -rf
(4) git add linux-3.18.3
(5) git commit -am "git add linux-3.18.3"
(6) git remote add origin [email protected]:/home/prj_git/linux-git.git
(7) git push origin master
(8) 查看提交记录:
[email protected]:/study/linux-git# git log
commit 1216e0790b45c59916c2ab75be15a6e563d3a540
Author: linux <[email protected]>
Date: Sun Jan 25 22:30:59 2015 +0800
git add linux-3.18.3
[email protected]:/study/linux-git#
主要参考文章:
http://blog.csdn.net/xiangpingli/article/details/43115173
时间: 2024-12-06 08:41:47