- sudo apt-get install git-core
- cd hello
- git init
- git add *
- git commit -a -m "hello project"
3. git本地clone仓库
- git clone /path/to/hello
- git clone user@server:/path/to/hello
- vi hello.c #modify the file
- git commit -m "add comment" #本地提交
- git push orgin master #提交到服务器
- git pull origin master #从服务器同步代码到本地
- git rm #删除文件
- git checkout master #检出master代码
- git checkout -b testing master #新建分支
- git merge #合并分支
- git help #查看git 常用命令
参考:http://blog.sunzy.org/?p=341
解决办法:
一,在服务器上初始化仓库的时候用git –bare init;
[receive]
denyCurrentBranch = ignor