Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
103 views

How to rebase a branch which changes files in directory backend onto a branch which moved the directory backend to apps/backend? I have two branches: main and work. Their common ancestor commit R had ...
Tooster's user avatar
  • 482
3 votes
5 answers
258 views

If I have merge conflicts, how can I take all changes from HEAD for a single file? Not for the whole rebase, but for a single file? Is this possible, or do I have to manually change it?
burn_stick's user avatar
4 votes
1 answer
183 views

I have added some notes to commits using git notes add <hash> -m potato But when I rebase or amend the commits, the note is not copied over to the new rewritten commit. According to the docs ...
Moberg's user avatar
  • 5,696
0 votes
1 answer
109 views

While doing lots of branch-management via rebasing I have a number of common situations that cause merge conflicts to occur for which I have developed helper scripts that resolve the situation. When ...
Greg's user avatar
  • 2,759
4 votes
3 answers
113 views

Note: I have already looked at the following answers and they don't seem to apply or work in the way I expect them to work: Reword one commit prior to merge Squashing old git commits that were before ...
Mirrana's user avatar
  • 1,823
2 votes
1 answer
189 views

I pulled from origin main, and I'm having issues handling conflicts on my branch. I did the following git checkout test (name of my branch) git pull origin main It tells me I have conflicts and is ...
Rue Vitale's user avatar
  • 1,993
0 votes
2 answers
90 views

UPDATE: The 1st question below has been resolved. My remaining question is what is the best way to rebase a fork before I submit a PR to a FOSS project so my changes (of multiple commits and sync's) ...
David G's user avatar
  • 146
-2 votes
1 answer
148 views

My history is linear: ... — B — C I make an interactive rebase to B~1 and set to edit B, pick C. All I do with B is to add a file to the gitignore, rm --cache -r . and commit --amend --no-edit it. ...
Ooker's user avatar
  • 3,400
0 votes
1 answer
66 views

Here is a typical example of executing git rebase --interactive --autosquash: git rebase --interactive --update-refs origin/master Rebasing (1/102) Rebasing (2/102) error: could not apply eff00df3... ...
tribbloid's user avatar
  • 3,860
0 votes
2 answers
212 views

I recently rebased my local feature branch onto the latest main branch to get up-to-date. Now, my commit history looks all weird—some commits seem duplicated or out of order, and when I try to push, I’...
Sai Karthik Motapothula's user avatar
6 votes
1 answer
161 views

I have a script that does a git rebase with the flags --empty=keep and --keep-empty. It's important that no commit is dropped because the script later relies on relative refs (like HEAD~3) and on the ...
Piotr Siupa's user avatar
  • 5,275
0 votes
1 answer
139 views

I have recently learned that git diff --cached shows how the new commit during an interactive rebase conflict after resolving the conflict looks. What does git diff compare during resolving a git ...
lmixa's user avatar
  • 79
1 vote
1 answer
58 views

I apologize, the situation I am about to lay out below is probably very confusing, because I am very confused myself. As this is related to work, I cannot provide the actual repository. Summary of the ...
ygtozc's user avatar
  • 48
1 vote
3 answers
122 views

I was reading through code when I found an issue, and had forgotten to pull the main branch before opening my branch to make my fix, and commit. I noticed when opening the PR that there were latent ...
Brydon Gibson's user avatar
3 votes
3 answers
159 views

Say there is a squash of 3 commits into a single commit like so: pick abc Jan 1 stuff squash def Jan 2 stuff squash ghi Jan 3 stuff pick jkl Jan 4 stuff pick mno Jan 5 stuff In the above, my ...
1192805's user avatar
  • 1,126
-3 votes
2 answers
114 views

Update My company adds a prefix to the commit history which i had gotten so used to, I didn't see it but of course git would, and that was causing the issue. Removing that prefix fixed my issue. ...
Karthik T's user avatar
  • 32.1k
2 votes
1 answer
113 views

I was mid-rebase, let's say on branch foo, and I accidentally ran git checkout -b net5, and somehow it proceeded successfully! (I intended to type this command into a different console window.) Now I'...
Grant Birchmeier's user avatar
0 votes
1 answer
75 views

After git push heroku main even with force: batch response: Repository or object not found: https://git.heroku.com/app.git/info/lfs/objects/batch Check that it exists and that you have proper access ...
user3763682's user avatar
0 votes
0 answers
26 views

I started a complicated rebase, it'll take hours. However, we asked me to do a little fix on the develop branch. Is is possible to stash my ongoing rebase so that I can do the little fix an come back ...
Juh_'s user avatar
  • 15.9k
3 votes
1 answer
122 views

I have a private file that leaks into the repo, and I want to delete it. Here are the commits I suppose that it is first added: git log --follow --diff-filter=A --find-renames=40% --pretty=reference --...
Ooker's user avatar
  • 3,400
2 votes
0 answers
134 views

I often watch git log --all --oneline --graph --decorate --colors to keep an eye on my rebases. Today, something rather unsettling is showing up: * b782b84 (HEAD -> dev, origin/dev) III * 22fe431 ...
iago-lito's user avatar
  • 3,276
0 votes
2 answers
171 views

After updating my local master, I routinely rebase my local branches. However, this time, I forgot to checkout master back between rebases and rebased one local non-master branch (branch_2 in my ...
Sergey Zolotarev's user avatar
2 votes
2 answers
100 views

Say my commit history looks like this: A -- B -- C -- D (HEAD) With a file test.txt, where each letter was added in the respective commit A B C D Without changing the git history (just changing the ...
Tom Huntington's user avatar
1 vote
2 answers
104 views

I have a github repository with a master and dev branch. When I'm working I usually make a change on dev branch. After I'm done, I create a pull request (PR) to master and merge it. The problem is one ...
Rico Codes's user avatar
-3 votes
1 answer
151 views

I have two branches, X and Y, and I want to cherry-pick a bunch of commits from Y to X, say, C..F, H, M. I can achieve this with: git switch X git log Y # Look up commits of interest git cherry-pick C....
flotzilla's user avatar
  • 1,286
0 votes
1 answer
318 views

I'm rebasing my branch on origin/master using git pull --rebase origin master Now I get some merge conflicts regarding git submodule updates: diff --cc cpp_lib index c14a3fe5,71b17a71..00000000 --- a/...
glades's user avatar
  • 5,472
0 votes
1 answer
1k views

I created a new branch feature from main and pushed some changes. Later, I noticed that main had new commits, so I wanted to update feature accordingly. Here's what I did: Checked out main and ran ...
Faraz's user avatar
  • 19
1 vote
1 answer
73 views

I have a main branch and a feature_branch. I did: git checkout feature_branch git rebase main What I want to do is get all changes from main for all files but 1, keep changes done in feature_branch ...
pip's user avatar
  • 37
-1 votes
2 answers
114 views

I have a git repository that has two branches with unrelated history like this A' A - B - [...] - C where the [...]-part is complicated (non-linear and many commits). Both the commits A and A' are ...
Stefan Witzel's user avatar
-3 votes
1 answer
143 views

I have two branches feature/abc and develop They both have different unrelated histories. I want to squash all commits that are in feature/abc and then merge or rebase the single commit into ...
Angad's user avatar
  • 1,132
-2 votes
3 answers
125 views

I have a script that among other things uses git rebase to remove a specific commit from the current branch. In one case, it removes a seemingly random file. After long debugging session, I've managed ...
Piotr Siupa's user avatar
  • 5,275
1 vote
2 answers
502 views

I tried to switch my branch but I could not because I was rebasing: fatal: cannot switch branch while rebasing Consider "git rebase --quit" or "git worktree add". It showed: Next ...
Milenko Markovic's user avatar
1 vote
1 answer
132 views

We are using VSCode in our project, we have .vscode/tasks.json tracked on the server just to make sure everyone is aligned with the same configuration. Since I wanted to add new tasks (just for me), I ...
nrofis's user avatar
  • 9,948
1 vote
1 answer
94 views

I had a feature branch which was based off of develop, let's call it feature-1. At the same point in time I also took another feature branch feature-2. feature-1 was a real feature branch that I've ...
stucash's user avatar
  • 1,298
0 votes
1 answer
55 views

I've got a git history like so: commit 027dbda16679e8c737c8ec63676aa564807cfaeb (HEAD -> master) Author: Camden Narzt <[email protected]> Date: Thu Dec 19 15:36:42 2024 -0700 migrate ...
Camden Narzt's user avatar
  • 2,073
1 vote
1 answer
55 views

I am trying to interactively rebase commits from the branch tmp/20241220-rebase-source onto tmp/20241220-rebase-target. The commits to rebase include a branching point and corresponding merge-commit (...
packoman's user avatar
  • 1,290
1 vote
1 answer
35 views

I want to configure kdiff3 to use a specific order for windows (from left to right): $REMOTE | $BASE | $LOCAL. However, I encountered an issue where $REMOTE differs between merge and rebase commands. ...
Pavel's user avatar
  • 1,167
-1 votes
1 answer
243 views

I want any extra remote commits to be added after any commits done locally. I have achieved this by doing git fetch origin git checkout -B newmain origin/main git rebase main git push -...
Mårten Svantesson's user avatar
1 vote
2 answers
643 views

There is a large Git repository (~4,000 commits) containing files in CP866 and does not contain a file named .gitattributes in the root of project. Is there any way to add .gitattributes (*.txt text ...
gitik's user avatar
  • 13
0 votes
1 answer
113 views

I want to correct a typo in a merge commit message in gitlab. The original branch doesn't exist anymore since it was deleted after merging. I can edit the squash commit message using its SHA and an ...
doom4's user avatar
  • 695
0 votes
1 answer
98 views

I have the following git situation: I was working on a branch, say profiles taken from master. The profiles branch has the profiles feature. While working I commit a million times every small change. ...
mrateb's user avatar
  • 2,539
0 votes
2 answers
87 views

Consider the following example: I change a file and change content X to A and push this change Somebody else pulls and changes A to B They amend or squash these changes and force push, so now on ...
SystemParadox's user avatar
2 votes
2 answers
129 views

We're transferring an old repository and as part of that we want to make a review of all existing code. The first commit is not empty, so we created a new root commit on main that is empty so that we ...
T'n'E's user avatar
  • 616
0 votes
0 answers
75 views

I have the following Git repository (git log --oneline): 658f9f0 (HEAD -> master) baz 4da6df7 bar 4f95d1b foo When I run the command: GIT_EDITOR='sed -iEn "2 p" --' git rebase --...
Piotr Siupa's user avatar
  • 5,275
1 vote
1 answer
90 views

We have a couple of repositories, let's call them RA and RB which are similar but not the same. RA is a export of an SVN repostiory were some libraries were extracted in the export process and RB is ...
Dequilla's user avatar
1 vote
3 answers
248 views

I'm working on an XCode project, and I want to push my local changes. However, my local and remote branch had diverged before I made local changes, so I understand that I have to do a 'git pull and ...
H L's user avatar
  • 13
2 votes
3 answers
134 views

My git history looks like this: A---B--------D---F \ / / \____C/__E/ Where head is now at F, and D and F are merge commits. I forget a rebase at E from D, but only realized after ...
Ras's user avatar
  • 147
0 votes
0 answers
34 views

My origin master looks like A -> B -> C -> D I want to remove the commits C and D so that my origin master will be like below A -> B I have tried do the hard reset and force push as below ...
CodeLearner's user avatar
-4 votes
1 answer
113 views

I know git rebase will update the SHA of the affected commits. But, correct me if I'm wrong, the parent commits will be updated too, then their parents would update, and so on. So, does the entire ...
BobDidley's user avatar
  • 221
1 vote
1 answer
108 views

In our team we have a requirement for our PRs: they need to be rebased before being merged, in order to achieve a "semi-linear history". I'm looking for an automated way to evaluate this ...
frozenkoi's user avatar
  • 3,248

1
2 3 4 5
36