git的使用

系统 ubuntu10.04

1. 安装 :

1 sudo apt-get install git-core  

2. 初始化一个仓库repository

1 mkdir mygit
2 git init --bare mygit

3. 初始化后,什么都木有,我们要建立一个master branch

1 mkdir myprj
2 cd myprj
3 git init
4 git add remote add origin ~/mygit
5 git add *
6 git commit -m "initail myprj"
7 git push origin master 

4. 好了,下面可以在其他地方用git clone拿到代码了

git clone ~/myprj

其他的暂时没有试用,用到再试试:>

  

参考:http://rogerdudler.github.io/git-guide/index.zh.html

原文地址:https://www.cnblogs.com/nickchan/p/3261541.html