github使用:
----------------------------------------------------------------------------------------------------------------
1 Linux下Git客户端使用
第一步: 生成ssh key,使用命令 “ssh-keygen -t rsa -C "email_address ”,your_email是你的email
$sudo ssh-keygen -t rsa -C "****@qq.com" 然后一路回车。
默认在用户的家目录下.ssh/id_rsa.pub文件里面
$sudo cd /root/.ssh/
第二步: 回到github,进入Account Settings,左边选择SSH Keys,Add SSH Key,title随便填,粘贴key。
第三步: 测试ssh key是否成功,使用命令“ssh -T git@github.com”,如果出现You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。
如果出现“Agent admitted failure to sign using the key.Permission denied (publickey).”这个错误的话,在命令行下执行"ssh-add",这样就可以了。
2 从GitHub克隆项目到本地
$sudo git remote add origin https://github.com/xxoo/FastDFS.git //由于暂时不支持https 所以用ssh 这段略去
git clone git@github.com:xxoo/Mysql.git
$ git remote set-url origin ssh://git@github.com/xxoo/FastDFS.git
$ git remote -v
$git rm README.md #本地倒库内删除
$sudo git add *
$sudo git commit -m "second" // 备注
$ sudo git push origin master
---------------------------------------------------------------------
如何贡献代码请看如下:
首先fork项目,那么自己的库就增加了fork的库
然后自己git clone到本地,修改后之后 然后提交到自己的git库
然后pull request 给作者 作者同意就贡献完成
http://site.douban.com/196781/widget/notes/12161495/note/269163206/
######################################################################
查看分支:
git tag -l -n
删除远程分支:
git push origin --delete decorator*装饰器*
$ git push origin --delete decorator\(装饰器\)
删除本地tag:
git tag -d decorator\(装饰器\)
创建tag:
git push origin --delete decorator*装饰器*
转载于:https://blog.51cto.com/zlong37/1559532