Questions tagged [rebase]
Changing the starting point of a branch in a Version Control System.
2,203
questions
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
-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. ...
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 ...
-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 ...
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 ...
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 ...
-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 ...
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 ...
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 ...
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 ...
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 - ...
-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 ...
-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 ...
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 ...
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 (...
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-...
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-...
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 ...
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 ...
-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 ...
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 ...
-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 ...
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 ...
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) ...
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
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
-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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
| |
|...