git --help出来的命令 + eclipse里用git小记

用法:git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

最常用的 git 命令有:
   tag        创建、列出、删除或校验一个GPG签名的 tag 对象
   rm         从工作区和索引中删除文件
   clone      克隆一个版本库到一个新目录
   pull       获取并整合另外的版本库或一个本地分支
   push       更新远程引用和相关的对象
   init       创建一个空的 Git 版本库或重新初始化一个已存在的版本库
   add        添加文件内容至索引
   checkout   检出一个分支或路径到工作区
   commit     记录变更到版本库
   bisect     通过二分查找定位引入 bug 的变更
   branch     列出、创建或删除分支
   diff       显示提交之间、提交和工作区之间等的差异
   fetch      从另外一个版本库下载对象和引用
   grep       输出和模式匹配的行
   log        显示提交日志
   merge      合并两个或更多开发历史
   mv         移动或重命名一个文件、目录或符号链接
   rebase     本地提交转移至更新后的上游分支中
   reset      重置当前HEAD到指定状态
   show       显示各种类型的对象
   status     显示工作区状态

比如说,在bitbucket上建了个repository(git地址为https://usrname@bicbucket.org/usrname/project.git),然后要pull到本地,可以这样:

进入要下载的目录,然后git init,会在该目录下建.git目录(包含配置文件,同步时就会同步.git所在的目录中的内容)

git add 文件或目录 是将该文件添加到本地索引(只表示把该文件包含在项目中(以后同步会同步之))

git commit是提交(包括本地的同步索引)

git push - Update remote refs along with associated objects
git push origin +dev:master
           Update the origin repository’s master branch with the device branch
git remote - Manage the set of repositories ("remotes") whose branches you track.管理远端repository的
           对remote管理可跟的参数有add,rename,remove等,add  名称  远端repository配置文件,就是添加本地git配置和远端的关联
           rename 远端repositoy在本地的旧名称 新名称

git clone则时把远端的repository clone到本地。

 

 

 

另外,关于在eclipse里用git,现在的SE是要自己下egit插件的,EE直接带了。配置GIT在windows-perspective(视图)里打开git可以配置。

posted @ 2015-05-10 23:18  toffrey  阅读(273)  评论(0编辑  收藏  举报