git的使用

来源:互联网 发布:淘宝上新哪个软件好用 编辑:程序博客网 时间:2024/06/16 19:49

1.在github上建立一个项目

比如:http://code.easyunion.net:99/xuliang/learngit.git

git@code.easyunion.net:xuliang/learngit.git


本地ecplise 中项目右键

team——》share Project...——》创建本地仓库


本地仓库和远程仓库关联(两种方式)

$ git remote add origin http://code.easyunion.net:99/xuliang/learngit.git

$ git remote add origin git@code.easyunion.net:xuliang/learngit.git


commit提交

$ git status查看状态

$ git commit -m "提交的文件夹名称"


push到远程仓库

$ git push -u origin master


============================================================

新建文件

touch main.m
将新建的main.m文件添加到仓库(这样git就会追踪这个文件)
git add main.m
把文件提交到仓库

git commit -m "新建了一个man.m文件"
把本地库的内容推送到远程

git push -u origin master





0 0