git 流程 rebase rename
git流程:
git init --bare
git checkout -b develop
git checkout -b feature1
feature1:
git add .
git commit -m "xxx"
git push origin feature1 # 等价于git push origin feature1:feature1
( $ git pull <远程主机名> <远程分支名>:<本地分支名>
git push origin 本地分支:远端希望创建的分支 )
git branch --set-upstream-to=origin/feature1 #设置feature1推送到远程feature1
git push #设置了上一条可以直接push
第一种做法
git checkout develop #在develop分支上,其他人已经commit过 也push过了。
git merge feature1 #分支难看 会有冲突
第二种做法(推荐)
git rebase master #此时在feature1分支 将rebase大体理解为merge 只不过调整了commit顺序的merge
上述指令将master分支的修改插入进来,feature1分支的修改放在最后,所以commit线路就很顺了。
可能遇到如下error:
Cannot rebase: You have unstaged changes.
Please commit or stash them.
git stash #暂存一下内容 git stash pop可以弹出内容
git checkout develop
git merge feature1
git branch rename:
git branch -m master psoc
把master 改为psoc
git tag
git tag -a "v1.0" -m "xxx" commitid
git branch -d feature1 #删除本地分支
如果省略本地分支名,则表示删除指定的远程分支,因为这等同于推送一个空的本地分支到远程分支。
$ git push origin :master
# 等同于
$ git push origin --delete master
上面命令表示删除origin主机的master分支。
git 流程 rebase rename的更多相关文章
- Git中rebase失败了如何进行恢复
rebase失败后的恢复 记一次翻车现场 记一次翻车的现场,很早之前提的PR后面由于需求的变便去忙别的事情了,等到要做这个需求的我时候,发现已经 落后版本了,并且有很多文件的冲突,然后就用rebase ...
- 聊下git pull --rebase
有一种场景是经常发生的. 大家都基于develop拉出分支进行并行开发,这里的分支可能是多到数十个.然后彼此在进行自己的逻辑编写,时间可能需要几天或者几周.在这期间你可能需要时不时的需要pull下远程 ...
- 关于git中git pull --rebase中的一些坑
在公司里面,每次我更改完代码,准备pull最新代码时,总是会遇到各种各样的问题.,因为对应的问题不同,解决方法很多.但是比较通用的办法还是有的: git pull --rebase //报错时 g ...
- fir.im Weekly - iOS开发中的Git流程
本期 fir.im Weekly 收集了微博上的热转资源,包含 Android.iOS 开发工具.源码等好用的轮子,还有一些 APP 设计的 Tips,希望对你有用. 精仿知乎日报 iOS 端 @我偏 ...
- [git]解决rebase冲突
git pull --rebase时产生冲突 有三个选项: git rebase --skip 效果是:抛弃本地的commit,采用远程的commit(慎用因为你本地的修改就会都没有!) git re ...
- git pull --rebase
git reset --hard orgin/master $ git push bit 1.8-subchannels To git@bitbucket.org:cms.git ! [rejecte ...
- Difference between git pull and git pull --rebase
个人博客地址: http://www.iwangzheng.com/ 推荐一本非常好的书 :<Pro Git> http://iissnan.com/progit/ 构造干净的 Git ...
- git pull --rebase 做了什么? 以及 Cannot rebase: You have unstaged changes 解决办法
最近刚学 git rebase,觉得很牛逼的样子, 结果今天就被打脸了. git pull --rebase 报错: Cannot rebase: You have unstaged changes ...
- git svn rebase出现了checksum mismatch的错误
http://stackoverflow.com/questions/3156744/git-svn-rebase-checksum-mismatch This solution was the on ...
随机推荐
- EMQ插件通过HTTP连接认证服务器实现认证
需求 在EMQ中添加认证插件,将到来的MQTT连接的ClientID.UserName.Password通过HTTP协议发送到认证服务器,用返回的数据决定是否允许该连接: 在连接时和断开时向服务器发送 ...
- Advanced Message Queuing Protocol ( 1 ) 概述
The Advanced Message Queuing Protocol (AMQP)是一个标准开放的应用层的消息中间件(Message Oriented Middleware)协议.AMQP定义了 ...
- webpack bundle中parentJsonpFunction的作用
parentJsonpFunction作用:使异步加载的模块在多个不同的bundle内同步. 假设有多入口文件 bundle1.js: bundl2.js: 在webpack打包后 加载流程: 1.b ...
- Text Elements(文本元素)对象
1.T-Code:SE32 操作路径:主菜单——转到——内文元素——选择内文 2. 清单标题(List heading) 用于定义Report标题名称及描述,如图: 2. 選擇內文 (Selectio ...
- docker windows下挂载目录和文件
我们利用docker启动项目的时候不能直接修改容器中的内容,只能在 run 的时候挂载到本地目录或者文件来进行修改. 例子:(路径可以忽略斜杠和反斜杠,我这边使用windows的路径没有报错.do ...
- 【LeetCode】121、买卖股票的最佳时机
Best Time to Buy and Sell Stock 题目等级:Easy 题目描述: Say you have an array for which the ith element is t ...
- 手动设计神经网络进行MNIST分类
前言: 用手工设计的两层神经网络,经过200个epoch,最后得到0.9599,约0.96的精度 正文 import tensorflow as tf from tensorflow.examples ...
- @Scheduled(cron = "0/5 * * * * *")将时间改为配置
有两种方法:第一种当然你可以把Scheduled写到xml文件中进行配置. 第二种在你的类前面添加 此处讲解第二种写法 第二种在你的类前面添加@PropertySource("classpa ...
- 复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中
cp -r /etc/p*[a-Z] /tmp/mytest1
- JAVA获取当前系统时间System.currentTimeMillis()以及获取运行时间
System.currentTimeMillis()产生一个当前的毫秒,这个毫秒其实就是自1970年1月1日0时起的毫秒数,Date()其实就是相当于Date(System.currentTimeMi ...