Questions tagged [rebase]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

Git copy branch before rebasing?

Lets say you have feature_branch off main and want to rebase it on top of main to pick up the latest changes. I often see people recommending to make a copy of your branch before doing a rebase in ...
Vastar's user avatar
  • 39
0 votes
1 answer
36 views

How does a git pull --rebase work and what will show up in remote commit history?

I am working on a project. Suppose I clone a repository "my_repo" that has A->B->C commits. Locally I do a commit D on day 1 but do not push. Someone does a commit E on day 2 and ...
tue2017's user avatar
  • 51
0 votes
1 answer
21 views

How can I switch the order of a commit I rebased on to to the top of my stack of commits?

On my local branch, I had the following commits: A->B->C->D in that order. I rebased on top of X, and had to fix some conflicts, and now I have X->A->B->C->D on my local branch. I ...
roulette01's user avatar
  • 1,998
1 vote
2 answers
57 views

Git rebase conflicts optimisation

Lets say I have created a branch F1 from main. This F1 branch has 20 commits in it. I now want to rebase this branch onto main to pick up changes from main git checkout F1 git rebase -i main However, ...
Vastar's user avatar
  • 39
1 vote
0 answers
4 views

Error while rebasing the changes from SVN to Azure repos git using svn2git tool

We have recently migrated the code from SVN to git using svn2git tool svn2git SVN_REPOSITORY_URL --no-minimize-url --notrunk --nobranches --notags --metadata --authors --exclude 'EXCLUDE_LIST'. And ...
Preety Mishra's user avatar
0 votes
0 answers
39 views

How to reproduce this change in pull request history?

I would like to know all the possible ways a PR could have such a history. Is it possible achieve it without git commit --amend --author="xxx"? I had some work done on the branches and when ...
burn's user avatar
  • 1
-1 votes
1 answer
59 views

Git rebase --onto rebased branch

I need some help on how to use git rebase --onto to rebase a working branch effectively. I tried to follow this doc https://womanonrails.com/git-rebase-onto Context I branched branch-B from branch-A. ...
Nainpo's user avatar
  • 145
1 vote
0 answers
27 views

How can I prevent git bash vi from crashing while rewording commit message with interactive rebase?

I am getting the below error message while attempting to reword a commit in git bash using vi/vim. I have tried on IntelliJ terminal and Git Bash terminal itself with the same result. hint: Waiting ...
friend.code's user avatar
-1 votes
0 answers
13 views

How do i merge with "upstream" in git properly on Github

I am putting upstream in quotation because i am not really sure it's called that. What happened ? I had a branch in a fork of a repo. Some time passed and there where conflicts while merging . I ...
Lampros's user avatar
  • 319
1 vote
2 answers
58 views

Git copy commit without checkout or rebase?

I am currently on commit 123456 and branch foo. I'd like to add a new commit to branch bar with the exact contents of 123456 (not rebased, just created from the same snapshot, so the diff will be ...
joshlf's user avatar
  • 21.9k
1 vote
2 answers
39 views

Is it possible to keep or drop a commit multiple times based on convenience?

My branching looks like this M1 --- M2 --- M3 --- ............. --- M50 --- M51 \ \ B1 --- B2 --- B3 --- B4 Here M is master commits and B is branch ...
Trilokinath Modi's user avatar
-1 votes
1 answer
45 views

git interactive rebase (reword) failure - changes order, loses commits

I wanted to rename the third latest commit and add 5 characters using git rebase, but the result was a total failure. The order changes and some commits seems to be skipped. I do the command: git ...
Galivan's user avatar
  • 4,910
2 votes
1 answer
55 views

Merge conflicts during reword (git rebase -i)

It seems, I am lacking some understanding of git. I am currently in the process of an extensive git rebase -i --root on origin/main(master), which is not a fork. Commits are not reordered There are ...
ahi's user avatar
  • 35
0 votes
0 answers
27 views

What is the correct way to manage two feature branches which depend on parts of eachother?

I have two git branches being developed concurrently: foo, and bar. After several commits on each, bar requires an object implemented within foo. Several commits after this point, foo requires an ...
Celeste Soueid's user avatar
0 votes
0 answers
20 views

Using rebase in original repo to synchronize my fork repo with it is a good practice?

Let me explain better, I do not like the merge dinamic, it gets too caothic in my opinion. And I really like rebasing, as it creates a linear history of commits. What is the best way of synchronizing ...
Vulgo's user avatar
  • 13
0 votes
0 answers
18 views

PR suddenly required approvals from unexpected approvers after rebase in github

There was an issue related to github behaviour and would love to have your ideas To start with, the structure of our department's repo is as follows: .codeowner -- main ---- department_a # Owner - ...
Pak Hang Leung's user avatar
-1 votes
1 answer
30 views

If I rebase (squash) a git history, will the files from the squashed commits removed?

Assuming I have a git branch, with lot of commits there always a few files replaces with new ones. Lets say: The initial commit contains file.txt with the content "1". The the last commit ...
user1988085's user avatar
-1 votes
1 answer
40 views

Unable to change a commit message after using rebase and rewording the message

There is a git commit for which I want to change the commit message (add a prefix to the existing message to be exact). The repository has been pushed to the remote bitbucket. The commit is a very old ...
pensee's user avatar
  • 405
0 votes
0 answers
38 views

What is best way to resolve merge conflict with protected master branch case?

In my team, we have production Gitlab with protected master branch to which I can only merge request from the browser. I accept MR myself. What's the problem: The master branch has hash F, the feature ...
koidula's user avatar
3 votes
1 answer
33 views

Squashing some commits which are followed by merges

In a git repository, I have a branch in which I have regularly merged the master branch: A -- B -- C -- D -- E -- F -- G (master) \ \ \ U -- V -- M1-- X -- Y -- M2 -- Z (...
pintoch's user avatar
  • 2,353
0 votes
0 answers
18 views

Spring flyway Rebase migration scripts

Hi in my project I have around 200 flyway migration scripts and I need to clean those and create a new baseline. For example, I have the following schema versions V1_0_0__baseline.sql V1_1_0__schema-...
Sajith Vijesekara's user avatar
0 votes
1 answer
72 views

Files added to .gitignore lost after attempting to squash a series of commits through interactive rebasing

I've been adding some files to .gitignore over a few commits, that I do not want pushed to remote. This includes files such as .Rprofile, which may contain information I do not want shared, and *.code-...
Pål Bjartan's user avatar
1 vote
1 answer
54 views

How to discard conflicts caused after rebasing in git and go back to the latest code pushed

Is there a way to disregard the changes made after my attempt to rebase and go back to the latest code I have pushed into main remote repository? Rebase left all the conflictinh classes with errors ...
Nancy Peters's user avatar
0 votes
0 answers
25 views

Git rebase from from one particular commit

Assume my git branches looks like this A -- B -- C -- D -- F -- * -- G -- H -- * -- K ( Main branch ) \ G -- H -- I -- J ( Feature branch ) one guy created a new Feature branch and coded ...
MohanaSundaram J's user avatar
-1 votes
1 answer
24 views

Modifying Authors and Utilizing Git Rebase in Collaborative Workflows

Is it feasible to modify the authorship information, including name, email, and commit content, for a specified range of commits? This scenario arises when multiple collaborators contribute to a ...
William Harris's user avatar
0 votes
1 answer
45 views

Can I rebase and merge a pull request to a branch that blocks pushing and unsigned commits?

Problem I have a repo on GitHub with the following branch protection rules enabled on main branch: Require signed commits: Commits pushed to matching branches must have verified signatures. Require a ...
HuangFuSL's user avatar
-1 votes
1 answer
30 views

Can the main branch block merges for specific files while allowing changes in other files to be merged?

For instance, consider two branches: A and B, with B branching off from A. Currently, branch B has modifications in several files. Additionally, there's a file C originating from branch A, which has ...
JH Lee's user avatar
  • 50
1 vote
1 answer
27 views

git/submodule: detached ahead after update --rebase

As per documentation man git submodule update, if run with an option --rebase then it should never leave submodules's HEAD in a detached state. --rebase This option is only valid for the ...
TruLa's user avatar
  • 1,031
1 vote
2 answers
59 views

Git rebase a branch from a branch that's also been rebased

Let's say I have this situation where branch1 was created from master. After a few commits on branch1, I also created another branch off of that called branch2. After this, someone else committed (D) ...
C.Tale's user avatar
  • 253
0 votes
3 answers
44 views

How to cut a feature branch into two at an arbitrary commit into another feature branch?

I have a feature branch that has too many features in it! For example, say we have the branch foo that has spanned too many files and items to really be just one feature. Master ---A---B---C ...
Lacrosse343's user avatar
0 votes
1 answer
20 views

Reverse squash a commit, aka act as if an older commit had been part of a newer one?

I have a repository where I commit once a week every Thursday. Today, after committing, when looking at the log, I noticed that I had made a commit on Wednesday last week. But those changes should ...
Evi1M4chine's user avatar
  • 7,022
2 votes
2 answers
33 views

Rebasing on master without merging every conflict of each commit of feature branch

I want to rebase my branch onto main. My feature branch is 40 commits ahead of the master branch. When I do a git rebase main I need to solve the merge conflict for the first commit, when that is done ...
thmo's user avatar
  • 139
0 votes
1 answer
42 views

Best way to sign (-S) each commit during an interactive rebase?

If you are doing an interactive rebase (eg: git rebase -i HEAD~3) and you modify n-2 [aaaa]: e aaaa commit message for n-2 pick bbbb commit message for n-1 pick cccc commit message for n After you ...
Nathaniel's user avatar
0 votes
0 answers
15 views

How to rebase while skipping a particular commit (non-interactive)?

I want to rebase a bunch of commits onto the master branch of my git remote, and do it in an automated manner without using git rebase -i. I want to skip the first commit of my new work before ...
PiRK's user avatar
  • 893
0 votes
1 answer
42 views

Rebase succeeds, but displays "fatal: ref HEAD is not a symbolic ref"

I read I can't git rebase --interactive anymore and other comments on the web. My repository seems just fine, I am on a branch, git log seems to match my expectations, ditto git status. I ...
Marvin's user avatar
  • 2,567
3 votes
1 answer
71 views

Why are newly added files deleted after aborting git rebase?

I was doing a rebase when some commit had conflicts. During resolving the conflicts I accidentally added all of my untracked files. Because I too don't keep track of untracked files I could not ...
joegomain's user avatar
  • 546
0 votes
0 answers
23 views

using git rebase interactive mode with --rebase-merges properly

something doesn't work quite right for me with git rebase -i --rebase-merges it goes like that. I ha e my main branch, from my main branch i diverged to branch develop_xxx for the time we are in code ...
codeScriber's user avatar
  • 4,582
2 votes
1 answer
39 views

Rebase button is disabled while trying to rebase child branch with parent

I have a branch named Test-Parent. I have created Test-Child branch from Test-Parent. I pulled the Test-Parent branch in my GitHub Desktop and created a file TempFile.txt and pushed. I need to rebase ...
वरुण's user avatar
  • 1,257
0 votes
1 answer
90 views

"git rebase master" is finding conflicts in files only in my branch and not master

Here is my problem: I branched off master, naming the branch other_branch. I worked a long time on my branch, rebasing daily we tabled the project for a month somewhere during that time, it appears ...
jaydel's user avatar
  • 14.4k
1 vote
1 answer
40 views

How do I disable GPG signing for `git rebase --continue`?

I am attempting to rebase a branch. My GPG/SSH agent setup is broken - git rebase --continue attempts to sign the commit and fails. I have done everything I can think of to disable GPG and nothing is ...
Ethan Reesor's user avatar
  • 2,090
0 votes
0 answers
58 views

How to rebase root project when submodules have been rebased

I have a project that uses many submodules. I have rebase all submodules to squash and clean commits, and also to implement semantic release. I wanted to rebase and squash commits also on the root ...
gbos's user avatar
  • 513
0 votes
1 answer
48 views

Rebase changes - without git

For a small .NET C# app I'm working on, I want to use the git merge/rebase algorithm, without git. My use case is game modding; a game has occasional updates pushed to my computer, they're rare but ...
KeizerHarm's user avatar
0 votes
1 answer
27 views

How do I go further back in time with git rebase -i

I'm trying to delete a single git commit from history. It introduced a file with a filename that can't be used on chromebooks, and is making it impossible for someone with a chromebook to pull any ...
Seph Reed's user avatar
  • 8,867
-1 votes
1 answer
42 views

Exclude files from rebase

I want to exclude some files while rebase or merge. I tried several approaches like adding them in .gitattributes: file1.php merge=ours file2.php merge=ours Using skip-worktree, .git/hooks/pre-rebase ...
Bhojendra Rauniyar's user avatar
0 votes
1 answer
41 views

Why does a simple rebase have weird conflicts?

Premise: I've never really worked seriously with rebase, I've always done some super easy jobs, without really never trying to understand exactly what and why was going on. But now I have to. I need ...
elect's user avatar
  • 6,785
1 vote
1 answer
183 views

How to resolve conflicts with git rebase?

I've two git branches in test. And I'm making the episode of Rebase conflict. However I'm too poor on git and it's easy to make a problem but hard to solve. Now the tree of commit is like this: What ...
Sheldon Wei's user avatar
  • 1,196
0 votes
1 answer
27 views

Why did my rebase add commits to the history of my dev branch, but not actually rebase onto main?

I am working on an open source project and have a clone in my git repo that I work off of. I started a dev branch (off my clone) off the main branch and have been working on the code for a few days. I ...
coniferous's user avatar
0 votes
1 answer
61 views

How can I remove a specific git commit that just includes a large file? [duplicate]

While working on a project I accidentally committed one of the videos I was testing, pushed it to remote, and made quite a few other commits and pushes before I realized that video was in there. I ...
James Fagan's user avatar
1 vote
0 answers
26 views

Reduce github repository size by deleting commits

My github repository once had one commit with a very large executable inside, and some time later I realized this takes me (and other people) huge of time to clone it from anywhere, so I deleted this ...
SUSY's user avatar
  • 11
0 votes
0 answers
40 views

How to combine two history commits without making the whole history linear?

For example I have a commit history like this * commit XXX |\ Merge: XXX XXX | | | | Merge branch 'dev' | | | * commit XXX | | | | e | | | * commit XXX | | | | d | | | * commit XXX | | |...
SUSY's user avatar
  • 11

1
2 3 4 5
45