git-rebase

How does git-rebase recognize “aliased” commits?

末鹿安然 提交于 2020-06-23 07:09:25
问题 I'm trying to better understand the magic behind git-rebase. I was very pleasantly surprised today by the following behavior, which I didn't expect. TLDR: I rebased a shared branch, causing all commit sha1s to change. Despite this, a derived branch was able to accurately identify that its original commits were "aliased" into new commits with different sha1s. The rebase didn't create any mess at all. Details Take a master branch: M1 Branch it off into branch-X, with some additional commits

How to restore linear git history after nonlinear merge?

大兔子大兔子 提交于 2020-06-09 17:30:15
问题 Few commits ago I accidentally did a nonlinear merge in my master branch. I have a habit of always trying to keep a linear history, so now I would like to restore the linearity. I have made a dummy repo, which simulates the real situation I'm having for the purposes of making this more simple. Here's a GitHub link to it: https://github.com/ruohola/merge-question Here's the output of git log --oneline --graph --date-order : * 88a4b7e (HEAD -> master, origin/master, origin/HEAD) 11 * 5aae63c 10

Easiest way to rebase multiple branches in a single lineage

北战南征 提交于 2020-05-23 08:20:08
问题 I have a two branches that I keep on top of upstream/master. One branch has the other as an ancestor so they form a line. U1 (upstream/master) \ A -- B (fixes) \ C -- D (features) Later, upstream/master moves forward... U1 -- U2 (upstream/master) \ A -- B (fixes) \ C -- D (features) ... and I want to rebase both branches on top. U1 -- U2 (upstream/master) \ A' -- B' (fixes) \ C' -- D' (features) I know two ways to do it, each with drawbacks. git rebase upstream/master fixes git rebase fixes

How to update a forked repo that has an unaccepted pulled request of some commits

╄→尐↘猪︶ㄣ 提交于 2020-05-16 05:53:27
问题 I followed the next tutorial https://medium.com/@topspinj/how-to-git-rebase-into-a-forked-repo-c9f05e821c8a this is my actual repo: As you can see there are two commits in my pull request and one commit in the original repository. I want to update my forked repository to bring the changes they made in its last commit before run the git fetch command to bring the changes my git status tell me: $ git status En la rama 13.0 Tu rama está actualizada con 'origin/13.0'. Then I made git remote add

Git - rebasing to a particular tag

こ雲淡風輕ζ 提交于 2020-03-17 05:49:04
问题 (This seems like it should be very easy to do, yet I'm coming up empty on searches so far.) I have a body of code from an upstream source, with various versions tagged in it on various branches. I am working on my "develop" branch which was based on tag "v1.0". many versions have come out since then, but while "v2.0" is interesting, I want to rebase my develop branch to "v1.5" and continue working there (assume I don't plan to feed that back upstream). Maybe later I'll rebase it again to "v2

rebase in progress. Cannot commit. How to proceed or stop (abort)?

ⅰ亾dé卋堺 提交于 2020-01-28 13:17:14
问题 When I run: git status I see this: rebase in progress; onto 9c168a5 You are currently rebasing branch 'master' on '9c168a5'. (all conflicts fixed: run "git rebase --continue") nothing to commit, working directory clean When I do: ls `git rev-parse --git-dir` | grep rebase || echo no rebase I see: rebase-apply I can't commit to origin. git branch Shows: * (no branch, rebasing master) develop master I'm stuck. I don't know what to do? Does it really take this long to rebase? git rebase -

rebase in progress. Cannot commit. How to proceed or stop (abort)?

那年仲夏 提交于 2020-01-28 13:16:41
问题 When I run: git status I see this: rebase in progress; onto 9c168a5 You are currently rebasing branch 'master' on '9c168a5'. (all conflicts fixed: run "git rebase --continue") nothing to commit, working directory clean When I do: ls `git rev-parse --git-dir` | grep rebase || echo no rebase I see: rebase-apply I can't commit to origin. git branch Shows: * (no branch, rebasing master) develop master I'm stuck. I don't know what to do? Does it really take this long to rebase? git rebase -

Amended commits revert to previous commit

余生颓废 提交于 2020-01-25 07:28:11
问题 I have a repo with master branch. I have patch-sets 1 to 10 amended in a single commit. Now I have amended the 11th patch-set in that commit and pushed the code in gerrit. I want to revert the commit back to 10th commit and push. How do I revert, as if I see git log, it does not list the commits in that patch-set. But it rather takes it as a single commit. I have explained the sequence of actions done below. Sequence of actions 1. Initially for patch-set #1 git clone repo made changes to code

Remove 4 commits from my git history

≯℡__Kan透↙ 提交于 2020-01-23 04:45:11
问题 I have done some commits and pushed them into my repository. Then I did a pull request but I realized there are some commits I don't want to be in the pull request. They look like this: My commits look like this: Correct HTML ab1c41c HTML escaping 8b38955 Merge branch 'master' into internationalized 2854662 Modified config b942f13 tried pushing b73d792 Added assets f20106e Added config 408118f Fixed views conflicts 86f2509 added layouts da27e11 Fixed layout markup 92d6bcc If I want to get rid

Code Lens not working properly after interactive rebase

五迷三道 提交于 2020-01-21 04:29:29
问题 In VS2015 all the code metadata from git displayed in the code via the CodeLens functionality regarding the author and changes disappeared after I did git rebase -i and ammended commits to correct the author name (a typo in git configs in one of my machines). The same happened after force pushed the corrected repo and pulled to another machine with different version of IDE - VS2013. In Team Explorer I can see all the relevant information and all the other git intergrations functions work fine