Questions tagged [git-history-rewrite]
The git-history-rewrite tag has no usage guidance.
git-history-rewrite
27
questions
0
votes
2
answers
44
views
Remove all commits prior to a commit with `git filter-repo`
Is there a way to 'remove' all commits prior to a specific commit all the way to the root commit?
I figured git filter-repo does this kind of stuff?
Although I wasn't sure if it will work when root ...
0
votes
1
answer
58
views
Git squash/combine old commits in a bare repository
I'm looking for a way to remove certain old commits from a history for a bare git repo.
Normally, I would do git squash and squash everything besides E and D commits.
That does not work for a bare ...
0
votes
1
answer
119
views
git replace --graft not truncating commit log
If I run git replace --graft SHA on a simple test repo, it seems to correctly truncate the repo (with respect to the provided SHA) when viewed via git log.
However on a more complicated repo when I ...
0
votes
1
answer
49
views
Change git history of PR merged long time ago from commit method to squash method
Hello to the community!
As you can see in the diagram there is a commit (cm1) that includes a lot of binary files that was committed in a local branch.
This commit was reverted at cm2 and at the final ...
-1
votes
1
answer
748
views
How can I move changes to a file from one commit to another?
How can I directly edit git history as to "drag 'n drop" changes from one commit to another?
Within a branch I have three commits:
A--B--C
The contents of which are:
A -- add file_a
B -- ...
3
votes
1
answer
55
views
Does Git leave any evidence that a rebase ever even occurred after the fact?
I understand that a rebase rewrites history. But is there any record or sign that a rebase occurred left in the repository after the fact?
0
votes
0
answers
42
views
Delete/Squash old commits while keeping the changes that they introduced [duplicate]
I'm trying to delete/squash a bunch of old commits that I don't want on my git history which were just made to put together code from multiple locations that were not using git (local folders from ...
1
vote
3
answers
614
views
Git filter-branch or filter-repo to update submodule gitlink?
I have git repository A that uses B as a submodule.
B's history has been rewritten after an LFS migration, but I would love it if A could still have its entire history functional. After the LFS ...
0
votes
0
answers
45
views
Is there a `map()` like operation in git, to create a modified copy of each revision as another branch?
I would like to create a copy of a branch history (all the way from the initial commit to the current state, with all the merges, etc), but I need to apply a custom logic at each revision - something ...
2
votes
1
answer
217
views
Remove a number of files from old commits on specific remote branch of git repo (without having to push to master branch)
I work with a code base shared by a number of people and have a particular branch that is for my personal use only. I made a huge mistake and about 10 commits ago removed a particular file type from ...
0
votes
1
answer
245
views
How to insert a git branch between branches (and possibly rename) without affecting other users?
I have a repo that I share with other users, so I'd love a solution that minimizes what others have to do, if there's a way they can just pull the changes, I'd love that.
Here's my current git ...
1
vote
1
answer
38
views
git Second Order History
When working on a patchest, I'm expected to provide a set of clean commits. Therefore I often find myself rewriting history repeatedly before my commit-set is clean and ready to be merged.
In this ...
1
vote
1
answer
31
views
How can I create a commit that rolls back another one?
For simplicity, let's create a repository with two commits only:
mkdir somedir
cd somedir
git init
echo hello > somefile
git add somefile
git commit -m 'first'
echo world >> somefile
git ...
0
votes
0
answers
451
views
Replace file (LICENSE.md) in git history safely
I have a repository hosted on GitHub in which I want to replace my LICENSE file with another LICENSE file in the git history. The original LICENSE file was added with the very first commit of the ...
5
votes
4
answers
2k
views
How to update my feature branch after a force push on the base branch . We only use rebase, merges are forbidden
We are working with a very simple structure in git.
First we have our master branch.
Below we have develop
And finally we can have any feature branch
We only use rebase for updating the history on our ...