git - how to re set up parent branch where we make new branch there
问题描述
I have a branch called FEATURE-1 and I created this branch from staging then:
- I push this FEATURE-1 and got conflict,
- I rebased
git rebase
into development
After I already tested my FEATURE-1 and no issue so far then I could go to staging branch.
Unfortunately not all codes from branch development should into staging, but my branch FEATURE-1 already got rebased from development.
To be safe better I want to get the source branch from master instead.
Is that possible for my branch FEATURE-1 set up to branch master for the source origin?
解决方案
如果您有功能 1 目前在开发时重新基于顶部,您可以使用 (使用git merge-base
)将其移动到 master 顶部
git rebase --onto master $(git merge-base develop feature1) feature1
这将需要:
m--m--m--m--m (master)
\
d--d--d--d (develop)
\
f--f--f (feature1)
至:
f'--f'--f' (feature1)
/
m--m--m--m--m (master)
\
d--d--d--d (develop)
推荐阅读
- python - python3:如何打印 groupby.last()?
- nginx - Why Nginx return 403 Forbidden error even using root user
- java - 如何知道 BigDecimal 是否可以精确转换为浮点数或双精度数?
- c# - How to create a Winform in Unity and display it?
- python - 大熊猫过去 n 个日期的真实值总和
- java - Quick Question in regards to the Methods in Abstract Classes
- ios - Firebase pod 更新未更新
- github - How to sove the error 'The remote end hung up unexpectedly fatal: sha1 file '
' write error: Broken pipe error'? - javascript - 在javascript中执行函数无穷大
- java - How to use counter.countPrimes(1000000)?