29 questions
-1
votes
2
answers
61
views
Fix history gap of deleted and then recreated file
I recently did a migration of a project (Flutter, if it matters) from an old version of the framework it is using to a newer one. At one point in the migration branch, I deleted most of the source ...
1
vote
0
answers
59
views
How do I restore commit history for a specific file that has been renamed?
I am trying to move some files from one repository (source repository) to a new one (target repository), and I want to restore all the previous commits of those files into the target repository to ...
2
votes
2
answers
804
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
103
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
204
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
63
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
1k
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
66
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
46
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 ...
2
votes
4
answers
1k
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
48
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
242
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
455
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
45
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
36
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
663
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 ...
6
votes
4
answers
4k
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 ...
1
vote
2
answers
150
views
How to move git commits common to multiple branches earlier in the main branch history?
I have a git repo that looks like this:
/C''-D''-F (featureB)
A-B-C---D---E (main)
\C'--D'--G (featureA)
I would like to move the common commits C and D earlier in the main branch
history so ...
2
votes
1
answer
277
views
Collapse git history to tags (combine commits between tags)
We have a fairly big (1000+ commits) repository with 7 years worth of changes and 6 released versions (each version represented by a git tag). We would like to collapse the history so that prior to ...
1
vote
1
answer
1k
views
How to get all git commits with libgit2sharp, regardless the branch?
AFAIK, Repository.Commits property return all commits reachable from current branch.
I would like to get all possible commits, regardless the branch.
I am using the following command :
var ...
0
votes
1
answer
725
views
When moving a Git submodule, how do I update the full history in the parent repository with the new URL for the submodule?
Could anyone help me please.
I want to move some Git repositories from one server to another, and rename them at the same time.
The problem I'm having is when some repositories are submodules of other ...
0
votes
1
answer
577
views
BFG repo cleaner not cleaning repository on remote
Hello I have a very big git repository of 13.2 gb on azure devops. I wanted rewrite the history of this git repository. To reduce the repository size. I used the bfg repo cleaner. I followed all the ...
1
vote
1
answer
105
views
Git history duplicated, is squashing commits possible?
Help: Git History Duplicated (O_O)
I tried to get ride of a file which contains an API key so researched about the remove a file from git history and used the command provided here: https://youtu.be/...
1
vote
0
answers
529
views
Not able to clear git history in Remote by BFG Repo Cleaner
I tried to delete one file from git history. I am able to delete that file from local and did the forsce push for all branches
my cli are:
java -jar bfg-1.13.1.jar --delete-files "{config.js}&...
4
votes
1
answer
6k
views
How to check what git rebase had changed?
Is there a way to check what git rebase had changed after doing the rebase and exiting rebase mode?
I used rebase to change the author name of previous commits.
While trying to do so, I rebased in ...
0
votes
1
answer
53
views
Amending commit in history with merges without flattening it
Lets say I have a history similar to this.
Develop is periodically merged into master.
a---b---c---d---i---j---k---o master
\ / /
e---f---g---h---l---m---n develop
How to ...
1
vote
1
answer
74
views
Take history from one repository change author information and push to another repository
We have two repositories,
1. source repository
2. target repository
When a commit comes in the source repository, I need to change the author name and author email then push to the target repository.
...
0
votes
2
answers
2k
views
How to delete a commit with a password from BitBucket git repository history?
I have accidentally committed a password to a BitBucket git repository some time ago, several commits behind the current master. While I removed the password later by committing without it, it still ...
5
votes
2
answers
323
views
Concatenate two git repository histories
I want to combine a cvs and a svn repository into a new git repo, without loosing history of course. The catch is the svn repo is a direct continuation of the cvs repo historywise. Someone just ...