git-rebase

Branch off a branch, How to rebase on another branch?

帅比萌擦擦* 提交于 2019-12-10 23:32:15
问题 I started working on branchB. Which was branched off from branchA. After a few weeks, the mainline branch develop have had a lots of commits merged in. Both branches A and B are way behind. --d1--d2--d3 ...2 weeks later... --d253 develop \ a1--a2--a3 branchA \ b1--b2--b3 branchB (current) I would like to keep up to date with the develop branch. And prefer to rebase my branchB off develop at its latest commit d253. Also all commits from branchA should be ignored . This will avoid me a huge

git rebase: rebased commit still in index?

萝らか妹 提交于 2019-12-10 19:43:58
问题 When I read about git-rebase, I understood the rebased commits should get lost. I say should because I noticed that, knowing the rebased commit sha, I can recall it. Suppose I have the following three commits A -> B -> C where C 's sha is cshaid . Then, if I interactively rebase fixing-up C into B with git rebase -i HEAD~2 and then I check the result with git log , I obtain the expected result, meaning A -> B' where B' 's sha is different from B 's sha. However, running git log cshaid shows

Linearize git history, preserving all commits

左心房为你撑大大i 提交于 2019-12-10 18:40:06
问题 I would like to take a git history that contains branches with merge commits, and turn it into a single linear history without squashing all the commits from the branch into a single commit. That is, starting from the following: * d667df5 (HEAD -> master) Modify merged file * 233e181 Merge branch 'featurebranch' |\ | * bca198d (featurebranch) Modify the second file | * fdc4e08 Add a different file * | 5e0c25f Modify file yet again * | 2426135 Modify file again * | eb56b32 Modify file |/ *

How do I edit after squashing while doing an interactive rebase?

痴心易碎 提交于 2019-12-10 18:06:46
问题 I can't figure out how to get access to the results of a squashed commit during a rebase. I would like to be able to edit the commit after 2 commits have been squashed into the previous one. My rebase file looks like this: p f70f90f ... some message ... s 514ee77 ... some message ... s ab01b05 ... some message ... <-- want to edit 3 commits here! p b109cc1 ... some message ... I have already tried: e f70f90f ... some message ... s 514ee77 ... some message ... s ab01b05 ... some message ... p

Git Rebase or Git Merge?

自作多情 提交于 2019-12-10 17:01:49
问题 I have two branches. Both are feature branches - new-ui and video-upload . video-upload is a fork of new-ui . However, video-upload has a TON of commits. I have multiple developers working on new-ui , and one just completed video-upload . But I can't quite figure out which will be the cleaner option to combine the two. I want to bring the completed work in video-upload into new-ui , but I don't know if I want to completely erase all the commits for video-upload and create a new commit history

Why does git rebase often have fewer merge conflicts than a merge?

别说谁变了你拦得住时间么 提交于 2019-12-10 13:28:38
问题 I've often heard it said that using git rebase reduces the number of merge conflicts as opposed to git merge, but I've never found an explanation of why this is the case. Simply replaying one set of changes on top of another set of changes doesn't magically dispel the inherent conflict when two people both modify the same line of code, so what makes rebase better? Can anyone provide a simple example where a merge would have conflicts but a rebase doesn't? UPDATE: After 3 additional years of

git - rebase ruins merge

我的梦境 提交于 2019-12-10 04:24:36
问题 I had two branches both independent. I worked on them at various points over a month. I went to merge one branch (let's call it apple ) into the other (let's call it orange ) by checking out orange and doing git merge --no-ff apple and everything went fine. In gitk I could clearly see the branches each had their own history and it was merged together in a merge commit on orange. Later I realize that a commit in orange is incorrect, there is a mistake in the build process, and I must edit that

git crash during rebase

南楼画角 提交于 2019-12-10 04:08:21
问题 I have rather big amount of file in repository. Thus git sometimes crashes due to out of memory exception during rebasing changes. E.g. git checkout feature git rebase master (nasty out of memory exception) ..... So once I got that exception, I tried again rebasing git rebase master And it told me that branch feature is up to date. That seems strange, as rebase finished with exception. Are there any way to avoid oom exception? May be somehow tell git use smaller amount of memory. Could this

Git rebase after merge confused about deleted file

前提是你 提交于 2019-12-10 03:54:33
问题 My Git repository has two files, alpha and beta , with identical content. If I delete alpha in my master branch, and edit it in my feature branch, then when I merge master into feature, I'm warned about a conflict. Assume I resolve this by deleting alpha . If I then rebase my feature branch onto master using git rebase master , alpha is deleted, but the changes I made to alpha on the feature branch are now applied to beta ! I get a conflict warning but it's happily resolved with an auto-merge

How to rebase my feature branch to development branch in git with least possible conflicts?

微笑、不失礼 提交于 2019-12-10 01:36:46
问题 I have my feature branch which has exceeded around 30 or more commits. Meanwhile in development branch few other features have been pushed from other developers. Therefore, Everytime a new feature is published on development, I am asked to: Rebase development branch onto my feature branch Resolve conflicts if any Continue developing in your feature branch The problem The second step is the chicken's neck here. On rebasing it gives me conflicts for every commit of that branch. This is really