Questions tagged [rebase]

Changing the starting point of a branch in a Version Control System.

rebase
Filter by
Sorted by
Tagged with
0 votes
2 answers
79 views

Can I replace an old commit with a commit from another branch?

Suppose I have a branch B1 whose last commits are C1 -> C2 -> C3 , and another branch B2 whose last commits are C4 -> C5 -> C6. How can I replace commit C2 on B1 with, say, commit C4 from ...
einpoklum's user avatar
  • 124k
1 vote
1 answer
335 views

Is there a circumstance where you will rebase your local repo and then push instead of push force?

My company is working to transition into using Git and we are currently working on the workflow. After rebasing a feature branch onto master, would you always use git push origin feature-branch -f ...
Alex's user avatar
  • 49
2 votes
2 answers
208 views

Mercurial - `hg graft` with custom destination?

Is there a way to graft a commit onto somewhere other than the current revision? The documentation makes it sound like there isn't: hg graft [OPTION]... [-r REV]... REV... copy commits from a ...
Mark's user avatar
  • 1,906
0 votes
1 answer
27 views

Git remove previous made commit, but keep future commits with merges

I have this kind of tree in Git: Now I want to remove commit 8a22e56e5, but keep all future changes and merges. Command git rebase -i -p ed36940de, but it will throw error error: commit 1e5c47382 is ...
Justinas's user avatar
  • 42.5k
0 votes
1 answer
1k views

How to do fetch and rebase?

git pull is just a: The git pull command is actually a combination of two other commands, git fetch followed by git merge. So I can manually do two commands: # I'm on master branch now! $ git ...
Green's user avatar
  • 29.8k
0 votes
1 answer
95 views

Reverted all my commits on branch still getting conflicts on rebase

I was working on a feature branch so long because of sick leave that the origin/develop branch is way out of sync with my feature branch. Since I had a small amount of changed rows but in many ...
Steve Waters's user avatar
  • 3,488
2 votes
2 answers
427 views

How to track GIT force pushes? Can you lose/delete commits?

Here is a repo we are working on as a team: https://github.com/hmcts/prd-pui-manager/pulls?q=is%3Apr+is%3Aclosed We are having miss understanding in why when we pull down master, we don't see the PR ...
ChrisGuru's user avatar
  • 107
1 vote
1 answer
254 views

Proper way to clean up a Git feature branch without merging it into master?

I have a feature branch of a fairly large project and I'm looking to rebase it, most likely into 1 (maybe 2) commits. I do not want to merge this into master yet but just want to prepare it first by ...
RohimL's user avatar
  • 187
0 votes
0 answers
42 views

Git rebase squash producing different results to plain rebase

When I perform a git rebase -i -X theirs and squash all commits except the first, some of the resulting files are different to the most recent version of the file in the branch that I'm rebasing, ...
Simon Morgan's user avatar
  • 2,138
5 votes
1 answer
434 views

Why is mercurial's hg rebase so slow?

The rebase extension to mercurial provides functionality similar to git's rebase. Letting the rebase execute takes something like 4 minutes (~240 s) for 100 commits. In my imagination this should be ...
Catskul's user avatar
  • 18.5k
0 votes
3 answers
853 views

Update a merge commit message that doesn't show up in git merge

I have the following commits and I need to update the middle commit with the branch name. ... ... 9a3de7d [#US810469]Add configuration 807fed0 Merge branch 'master' of github.xx.com:org/repo 6153e1e [...
melis's user avatar
  • 1,215
13 votes
1 answer
3k views

Rebase without removing old branch

I have the following situation in Git: A--B--C--D--E--F--G \--H--I I want to rebase the branch, but keep the original branch. So I want this: A--B--C--D--E--F--G \--H--I \--H'--I' ...
Peter's user avatar
  • 13.9k
2 votes
2 answers
2k views

Rebased with merge conflicts: How to undo?

I was working on a feature branch B that I had branched out from master a month ago. As other new features came in, the master branch kept getting updated. This is how master branch looks like right ...
code's user avatar
  • 2,145
4 votes
3 answers
20k views

Undo a git rebase

Using intelliJ i am working on a feature branch, i wanted to integrate the changes my team did on master into my branch, but i messed it up. I checked out master, from Git pop up i selected the ...
JBoy's user avatar
  • 5,567
2 votes
1 answer
733 views

Remove multi merge feature branch in git history

I am currently converting a SVN repository to Git and during this process I want to make the history as linear as possible. The problem is that I have some feature branches in SVN which merges from ...
Björn Blissing's user avatar
0 votes
1 answer
340 views

Is it possible to rewrite very old git history for develop branch

I am using git flow. I made some rules how to keep git history clean because I am generating changelog from these commits. But some old commits (made directly to develop) or merged feature branches ...
Dawe's user avatar
  • 580
1 vote
1 answer
40 views

Move Older Commits To New Separate Branch (Pushed To Remote)

I am new to Git and would like some help. This question is similar to Move the most recent commit(s) to a new branch with Git but that question asks about the most recent commits. This is not what I ...
Yang K's user avatar
  • 427
0 votes
1 answer
115 views

Amend commit while splitting in rebase

Sometimes I accidentally amend the previous commit with the changes I want to make to the one before that, i.e. HEAD~1. I usually go into rebase interactive mode with git rebase -i, split the commit ...
Connor Blakey's user avatar
2 votes
4 answers
4k views

Git: Combining multiple commits into a single commit

I am working on a git repository where I do not have any merge write. There are large requirements which requires at least 1-3 weeks to complete. I take out a branch from master and do my changes in ...
Rohail Usman's user avatar
0 votes
1 answer
313 views

How to propagate squashed commit from master to develop and feature branches

I squashed initial commits in master to one commit using git rebase, generating a new squashed commit, but on develop branch, the commits remain as it is. How do I replace the old commits with new ...
PrivateOmega's user avatar
  • 2,725
3 votes
0 answers
296 views

git-rebase removes files but traces remain in git-rev-list [duplicate]

I am trying to remove (huge) files from the history of a repository. I used git-rebase to drop the commits with the files that I want to remove, and it didn't complain, but running git push origin ...
Antoine's user avatar
  • 620
0 votes
1 answer
101 views

Git Reset after multiple bad rebasing after push

I'm new here so I'll try to do my best. I have some troubles with a my git branch. Indeed I am developing on a branch called let's say 'myName'. I am working on a new feature that is taking a long ...
Ygal Messas's user avatar
46 votes
5 answers
35k views

Stuck in a git rebase ... how to reset

I am part way through a git rebase and I am stuck. I can't remember exactly what happened but I was using a UI and deleted a checked-out branch and things just seemed to go blank. I restarted and ...
Simon Woods's user avatar
2 votes
0 answers
89 views

How to amend history commit message without overwriting PRs and changing the authors?

I've googled the method to "amend history commit" by typing git rebase -i c27f02e , and then change the pick to squash or reword. These operations can successfully amend the history commit ...
walkcc's user avatar
  • 301
-1 votes
1 answer
23 views

Git rebase, squashing two commits and keep everting all as it is

Hello I have this type of situation 13f5337 100 c8fw28f 99 3554tb0 98 2321dsw 97 a551654 96 41c990d 95 1343756 94toxic data Fixed 96236fb 93toxic data 8894377 92 94t6ff1 91 dda323w 1 I am trying to ...
Dzonaton's user avatar
0 votes
1 answer
31 views

how to create appropriate branch for this case

Let's say I am working on 2 tasks. I created one branch for task1_base and one branch for task1_work. task1_base branch will not change and task1_work will change. I finished the changes on task1_work ...
msProgram's user avatar
  • 107
1 vote
1 answer
1k views

IntelliJ interactive rebase failing

Hello I can do rebase with current branch onto the selected but when I try to do interactive rebase from VCS/git/rebase this is what I am getting: 18:42 Rebase Failed cannot spawn sh: ...
Krasimir Dimitrov's user avatar
1 vote
3 answers
2k views

Undoing git rebase mistakes

I never had too much trouble with rebase, mainly because I tend to be more careful while committing regarding the amount of code and scope. But while working to merge some legacy projects changes with ...
Thiago M's user avatar
  • 181
3 votes
2 answers
823 views

How to make sure fixup commits are not merged into master branch

I use git commit --fixup (or --squash) a lot, especially during code reviews. Obviously these commits should eventually disappear after a git rebase --autosquash but it worries me that I might forget ...
George Kettleborough's user avatar
1 vote
2 answers
2k views

How to solve "This branch has conflicts that must be resolved" using Rebase

I have a PR on github but have the following issue on my branch features that says: This branch has conflicts that must be resolved My company solely uses rebase. How would I solve this using rebase?...
lost9123193's user avatar
  • 10.7k
1 vote
3 answers
947 views

Why do I get this merge conflict with git rebase interactive?

I'm still learning git. I have a file called names.txt. With this text. This is my commit history The first commit added the file. The second commit added the first line Mary. The third commit ...
enzio902's user avatar
  • 457
0 votes
1 answer
12 views

Is it possible to select the first commit made in the repository in an interactive rebase?

I'm still learning git so don't have a clear idea. I created a new repository and made 3 commits. I want to rebase all the commits starting from the first one. I do the command git rebase -i ...
enzio902's user avatar
  • 457
0 votes
1 answer
134 views

Git Flow, checked out branch from master, rebase to develop

Im working with git flow and I have a master and develop branch. Sometimes people dont checkout from master but develop. When the PR is submitted in GitHub it points to master. Can I somehow change ...
Code Spirit's user avatar
  • 4,406
1 vote
3 answers
2k views

How to squash/rebase in a single shot

How can I, with minimum effort, squash all my commits (even with merges and conflict resolutions) to a single one on a feature branch and then rebase on top of the branch where I started developing ...
eftshift0's user avatar
  • 28.3k
3 votes
1 answer
1k views

Git - rebase to one commit without resolving conflicts

Suppose I've been working on a branch called my-branch, occasionally merging commits from master to stay up-to-date. On some merges I had to resolve conflicts, which was time consuming. Now I'm done ...
Rafał G.'s user avatar
  • 1,640
2 votes
1 answer
3k views

Git rebase wrong commits

I have pushed one commit (Helm chart) to the wrong branch, then CI has automatically created Helm package and another commit on this branch. Then another user has pushed his commit on the same branch. ...
DisplayName's user avatar
1 vote
2 answers
135 views

Best way to rebase atop a repo with many moved files?

I have two branches A and B. I started from the position where Branch B is about 200 commits ahead of Branch A. In the mean time, many files in Branch A have been moved, for example the Java files ...
adamretter's user avatar
  • 3,947
8 votes
1 answer
4k views

Change parent of a commit

I try to move a commit on top of another branch ignoring all changes done in target branch. Current situation is: master ↓ --A--B--C \ D--E I want to move commit E in front of ...
Foobar's user avatar
  • 83
4 votes
2 answers
890 views

resolve all "changed-by them" or "deleted by the them" during rebase

I'm doing a rebase where I would like to always take the conflicting files as-is from the branch A. on branch A git rebase -X theirs branchQ ( According to Is there a "theirs" version of &...
Johan Lundberg's user avatar
1 vote
1 answer
1k views

Isolate git changes from one branch to another by specific commit

I've been looking around for a while and different options trying to find an answer but am struggling with how I can accomplish this function. We have a high volume of changes and sometimes certain ...
CV-Dev123's user avatar
0 votes
1 answer
262 views

Error rebasing: non existing untracked files would be overwritten

I'm trying to squash a few commits into a single one. The changes made involve changing file contents, as well as only changing the filename case on some files or their directories. When running git ...
aryzing's user avatar
  • 5,392
2 votes
1 answer
1k views

Github: Fetch and rebase fork on forked master

I've created a fork of a project, and added ~40 commits to our master. At some point in time I thoughtlessly rewrote history with a forced push because I couldn't push "for no reason at all" and ...
Redsandro's user avatar
  • 11.3k
1 vote
1 answer
892 views

Undo git rebase skip on local

I did a git rebase HEAD~3 to edit some commit messages, however when I entered the interactive mode, it showed more than my last 3 commit messages. It showed a bunch of other commits. Every time I ...
henhen's user avatar
  • 1,105
1 vote
1 answer
2k views

Why does git pull origin develop --rebase cause conflict when git pull origin develop doesn't?

Now normally I use git pull origin develop into get the latest updates from the develop branch. Recently, my team has been transitioning into using rebase instead of merging so I'm a bit confused ...
craexus's user avatar
  • 39
0 votes
1 answer
188 views

After git rebase history is still not linear

This is our workflow for rebase: Pull develop Checkout feature-branch "git rebase develop" solve conflicts after rebase, (still on feature) "git push --force" go to gitlab and create merge request on ...
Biafra's user avatar
  • 93
1 vote
1 answer
356 views

What am I doing wrong when I try to rebase in Git?

I recently started at a new company where the team chooses to rebase new changes onto the develop branch rather than merging changes into it. I thought I understood how this works but I run into ...
BooleanCheese's user avatar
4 votes
3 answers
3k views

Why do dropped commits from a git rebase cause merge conflicts?

My Problem I have been working on a git repo. Before publishing my changes, I'd like to remove some commits - a023b43, 315424b and 7b51754 - as they do not reflect any meaningful changes. The only ...
Adam Matan's user avatar
  • 133k
1 vote
1 answer
71 views

Git: How do I rebase Branch Feature back onto Branch Develop minus Branch MyLocalChanges

We have a develop branch and many feature branches that are created from develop as needed and will eventually be merged back into develop. When I work, I have a set of local changes I like to make,...
Jerry Asher's user avatar
1 vote
1 answer
321 views

Rebasing on a shared branch when everyone rebases

I read up online that rebase command shouldn't be run on a public branch. I have the following scenario: master having commits A1 <- A2 <- A3 stable branched from master at A1, having commit ...
linuxNoob's user avatar
  • 640
2 votes
2 answers
1k views

Is it okay to rebase after having pushed commits in this instance?

I have a long-lived development branch off the master branch where all modifications are done until this branch is merged back to the master branch. Occasionally, however, a critical fix will be ...
Booboo's user avatar
  • 40.8k

1
15 16
17
18 19
45