100 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 ...
0
votes
2
answers
65
views
Merging problems with re-created git repository
We have had a big git repository that we have re-created under a new git url. The process was the following
create new empty git repo
copy paste the code from the old main branch, and commited it
re-...
0
votes
0
answers
48
views
Moving folders into newly created folder while preserving history
I have a bitbucket git repository which has two big folders (Folder1 and Folder2) with huge and important commit history inside. I want to create two new folders (NewParentFolder1 and NewParentFolder2)...
-2
votes
1
answer
59
views
Does "git reset --hard HEAD~1" on main branch remove this commit from another branch's history (when that branch is based off main)?
Let's say I have a, b, c, d commits on main. I use "git checkout -b new-branch" while on d. On new-branch I make commits e, f.
I want to remove d from main, but keep it in new-branch. If i ...
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
50
views
git is trying to merge on 'edit' command during 'git rebase --interactive <commit>'
I have history in git like the following:
<hash2> commit2
<hash1> commit1
<hash0> initial commit
I do git rebase -i <hash0> and choose to edit (pick -> e) both commits (...
0
votes
1
answer
187
views
After renaming file in Android studio it is deleting from git (and lost history)
For some reason, when I rename a file in Android Studio through the "refactor -> rename..." menu, the file is displayed in Git as new and the old file is deleted. Here's an example:
There ...
1
vote
0
answers
70
views
Show Git subtree commit history when --squash option was used
Is there any way to show only subtree history, like with git log but filtering only specific subtree's related commits?
When I add a subtree with --squash option only a merge commit is shown, but the ...
1
vote
1
answer
34
views
How do i set the number of commits that are shown in the new showOutgoingChanges in the november insider release?
I am trying to see all the previous commits i made to a repo. The new showIncomingChanges and showOutgoingChanges settings are supper useful in that regard. i can see what code i added/removed in ...
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
3
answers
132
views
Get git commits between "cuts" of a reference branch
We have a master branch from which we periodically branch out ("cut") release branches. All the release branches are guaranteed to have the prefix release/.
Suppose that at some time in the ...
1
vote
1
answer
70
views
How does Github identify commits affecting a file path during a merge commit?
I've read in other posts that a commit with parents of size 2 usually means a merge commit. This allows me to filter out basically all of those merge commits that say merge pull request or merge ...
1
vote
1
answer
72
views
Create relative path expression between two git commits (one ancestor of the other)
If there are two git commits (or refs) A and B, and if A is known to be an ancestor of B in the history, is there an easy way to compute an expression that shows how A can be reached, starting from B (...
1
vote
1
answer
242
views
What is the best way to create an offline backup of a git project (Unreal Engine)?
I've just started using Git and GitLFS for version control on game projects that I'm making with the Unreal Engine. These projects use a lot of large binary files and so they're expensive to store on ...
0
votes
1
answer
41
views
Change git history and branch
I have 2 branches which is created at the same time from master branch. Both has been merged to master after changes. Branch history look like below:
My git structure
I want to change the structure so ...
1
vote
1
answer
155
views
git - how can I _copy_ a file and still be able to use the original history when blaming?
How can I create a copy of a file and make it so that git understands where it is coming from? If I just do a copy and add it to the branch, git is not able to figure it out:
$ git log --oneline --...
0
votes
0
answers
48
views
Git restore branch with changed history
I created a branch
git checkout -b myBranch
I made 3 commits onto the branch, lets name then One, Twoand Three.
I did an interactive rebase.
git rebase -i origin/master
With
pick One
drop Two
drop ...
-3
votes
3
answers
538
views
Remove all files from Git repo history with path having escape \ in filename with git filter-repo
I have special filenames with escape \ characters stored in Git repository on Debian 10 Linux.
Problem: it is not possible to git checkout files on Windows, which have incompatible characters in the ...
3
votes
3
answers
539
views
How to remove all files from GIT repo history with path having colon : in filename?
I have ISCSI node filenames with colons stored in GIT repository on Debian 10 Linux.
Example:
'iscsi/nodes/iqn.2000-01.com.synology:NAS01-DS916.nas/ff11::111:11ff:ff1f:1ff1,3260,1/default'
'iscsi/...
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
1
answer
118
views
Combine two git repositories into one higher level repository
My project consists of two folders, each with its own repository:
project/
|--frontend/
|--|--.git
|--backend/
|--|--.git
So far I have worked on them locally. Now I want to create one global ...
0
votes
0
answers
129
views
How to set --allow-unrelated-histories on FIRST pull by default?
From git-merge Documentation:
By default, git merge command refuses to merge histories that do not share a common ancestor. This option can be used to override this safety when merging histories of ...
0
votes
1
answer
89
views
Git: How to delete commits that point to deleted files
Somehow, I accidentally merged a branch from an unrelated repository.
Now I see tags and commits, that do not belong to my repository (it could well be I used the --ignore-unrelated-history command ...
-2
votes
1
answer
2k
views
Is there any way to save Git history into a ZIP file?
I'm a beginner in using Git as version control. I need to compile my Git History and compress it into a ZIP file. But I can't seem to find a way to find the physical file that shows Git History. The ...
6
votes
4
answers
13k
views
Git - remove all history prior to a specific commit
I use git for various projects (personal repositories only), and I want to do some housekeeping.
I have a downloaded git project tree that has a large history of commits. After downloading I made a ...
0
votes
1
answer
848
views
I've problem with vscode -> command 'git.viewFileHistory' not found
I want to use VSCode git history extension but there's an error
Command git.viewFileHistory not found
What should I do?
2
votes
3
answers
117
views
Get list of all edited files since branching
I'd like to get a list of edited files since branching from my master branch (not comparing to the most recent head of master branch, but master at the point of branching).
Is this possible?
This ...
-2
votes
1
answer
106
views
How can I get git history (date range) log to a file without author, date, commit message and commit hash
How can I get git history (date range) log to a file without author, date, commit message and commit hash?
0
votes
1
answer
892
views
Fast forward merge after git flow hotfix
I have three branches production , develop and a fix branch as shown below (A,B and C are commits) :
A (production,fix)
\
B (develop)
I want to be able to only perform fast forward ...
1
vote
1
answer
41
views
Will successive add + remove commits stay in the history?
I've just written myScript.sh, which fixes something specific at this point in time in my project and will do nothing after being executed once.
Since all our code is tracked in Git, and to share it ...
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 ...
2
votes
1
answer
802
views
Can gitversion be made to apply a unique tag to an existing tagged commit?
Following the gitflow branching model on a project, my "development branch" is named dev, my release branches are prefixed with release/, and my "production branch" is master.
Our ...
0
votes
2
answers
885
views
How to merge a git repo into a parent repo maintaining commit history?
I have always kept track of files in the child repo. But now I also need to keep track of another child, so I renamed them to child1 and child2. I would like to maintain only a parent directory that ...
2
votes
1
answer
179
views
Does git mv folder and merge afterward new file from feature branch to the modified path, deletes its history?
I have the below scenario:
main branch before consolidation:
│ └── dir1
│ │ └── python1
│ │ │ └── test1.py
│ └── dir2
│ │ └── python2
│ │ │ └── test2.py
│ └── dir3
│ │ └──...
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 ...
2
votes
1
answer
56
views
How to delete many files of same format from git history
I have situation where I need to delete many documentation files like *.html files from git history
These HTML files over years of development causing git repo to bloat its size. It's difficult now ...
1
vote
1
answer
1k
views
How to move starting point of branch to an older commit [duplicate]
I'd like to rebase my branch onto an older commit to exclude code added by the newer commits.
What I have:
A---B---C---D---E master
\
F---G---H---I---J experiment
...
2
votes
2
answers
8k
views
Remove file commited in old commit
I have 6 commits and each of them have multiple files commited. My "problem" is, that I commited a file which I should not commit, and I want it to dissapear from that old commit, so I can‘t ...
6
votes
1
answer
645
views
Can I shorten the history of a git repository
At first, I made a shallow-clone. After this, I found some old commits introducing some large files. For example, these old commits replaced a binary file again and again.
Now, I didn't want my local ...
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 ...
0
votes
2
answers
181
views
Git: How are copies of a file with a shared history handled?
I backup my CSS userstyles to a git repo like so:
❯ fd
stylus-2021-05-18.json
stylus-2021-05-20.json
These ...
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 ...
4
votes
1
answer
1k
views
How to make Pycharm show all git commit history for subfolders?
Since some point (probably update) Pycharm stopped showing git history for one of project subfolders.
Question
Does it have a functionality to enable all commit history for my sub-folder?
I tried to ...
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
2k
views
Determine parent branch/commit from git history
I've got following history in git:
* 02e085a (master) readme update
| * 1d940da (HEAD -> b1) search.py
| | * 7aaa12d (b2) file2
| |/
| * 7be9db9 file1
|/
* 22601c0 initial commit
Now I'm on b2 and ...
0
votes
0
answers
110
views
Is there a safe way to remove an old commit that is taking up a lot of space in Git? [duplicate]
I want to preface this question by saying that I'm aware of the fact that rewriting history in Git is usually a bad practice, but I'm facing a problem to which I cannot seem to find another type of ...
0
votes
1
answer
502
views
Move single Git file between branches with its' history
I'm using Git to manage a small repository of small shell scripts.
There's a lot of them and none justify a repository of their own, so I clump them together in a single repository.
To keep things ...
2
votes
1
answer
342
views
How to find git commits which deleted lines in a file
I have a large CSV file where data usally only get appended and then git committed.
But I am curious if there were some commits in the past which deleted lines from this file.
To date, several hundred ...
0
votes
0
answers
52
views
git - is there a way to untrack several remote merged branches?
The organization I am working for decided to keep merged branches for history purposes in the repository. The repository has 900+ tracked merged branches and this brings its performance down.
Is there ...
11
votes
3
answers
13k
views
Git get history of branches that i was in
I need to see the history of branches that i was using. For example i have 4 branches: master, b-1, b-2, b-1-1. Thе branch "b-1-1" is child of branch "b-1". First i was at master ...