git基础操作
2015-09-30 09:31
337 查看
git操作之PD篇:
―――――――――――――――――――――――――――――――――
1. 本地什么都没有的时候~~~~~
a.
git clone git@git.corp.xx.com:_java_crm/w_one.anjuke.com #Clone远程版本库
b.
$ git init #初始化一个版本仓库
$ git remote add origin git@git.xx.com:_java_crm/w_one.xx.com #添加远程版本库
#语法为 git remote add [shortname] [url]
$ git fetch origin #抓取远程仓库
#语法为 git fetch [shortname], 默认使用origin
2.operate pmt1001项目(先让QA拉对应项目分支:pmt1001)
$ git fetch ―-all #fetch所有连接仓库
$ git checkout pmt1001 #切换至pmt1001分支
3. 开发完成提交远程
$ git fetch
$ git rebase pmt1001
$ git rebase release #在对应的分支上rebase到release
#可能会有冲突,解决完后再继续
$ git add . #将所有修改过的工作文件提交暂存区
$ git commit -am 'msg…’ #提交本地代码
$ git push --force origin pmt1001
4.线上bug,在hotfix分支上修复完毕之后
$ git fetch ―-all
$ git rebase master
$ git add .
$ git commit -a -m 'fix ga bug'
$ git push origin hotfix:hotfix
―――――――――――――――――――――――――――――――――
1. 本地什么都没有的时候~~~~~
a.
git clone git@git.corp.xx.com:_java_crm/w_one.anjuke.com #Clone远程版本库
b.
$ git init #初始化一个版本仓库
$ git remote add origin git@git.xx.com:_java_crm/w_one.xx.com #添加远程版本库
#语法为 git remote add [shortname] [url]
$ git fetch origin #抓取远程仓库
#语法为 git fetch [shortname], 默认使用origin
2.operate pmt1001项目(先让QA拉对应项目分支:pmt1001)
$ git fetch ―-all #fetch所有连接仓库
$ git checkout pmt1001 #切换至pmt1001分支
3. 开发完成提交远程
$ git fetch
$ git rebase pmt1001
$ git rebase release #在对应的分支上rebase到release
#可能会有冲突,解决完后再继续
$ git add . #将所有修改过的工作文件提交暂存区
$ git commit -am 'msg…’ #提交本地代码
$ git push --force origin pmt1001
4.线上bug,在hotfix分支上修复完毕之后
$ git fetch ―-all
$ git rebase master
$ git add .
$ git commit -a -m 'fix ga bug'
$ git push origin hotfix:hotfix
相关文章推荐
- 浮动层如何贴住网页内容右边
- Android任务和返回栈完全解析,细数那些你所不知道的细节(来自慕课网社区论坛)
- 信息安全事件/案例收集
- iOS 用CocoaPods做iOS程序的依赖管理(基于Alcatraz)
- android布局单位
- Web前端知识框架总结
- 通过 sql语句获得一个 表的备注 及 字段备注 类型
- 一年内自学MIT的33门课? 疯狂学习有方法
- 程序员必知8大排序3大查找(一)
- android的task任务栈
- vi代码智能提示与补全环境的配置
- test9.4
- UITextField和UITextView被键盘遮住的处理办法
- robot framework(2) 环境搭建
- 约瑟夫环
- 模式串的快速匹配算法,kmp算法,尊重前人成果,创造新未来
- 奔跑的九月!
- Java 多线程断点下载文件
- 在Windows下搭建Android开发环境
- Delphi BLE 控件