Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3937126
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:01:58+00:00 2026-05-20T00:01:58+00:00

I have a git branch (called v4), that was made from master just yesterday.

  • 0

I have a git branch (called v4), that was made from master just yesterday. There were a couple of changes to master, that I want to get into v4. So, in v4, I tried to do a rebase from master, and one file keeps screwing things up: a one-line text file, that contains the version number. This file is app/views/common/version.txt, which before rebasing contains this text:

v1.4-alpha-02

Here’s what I’m doing:

> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

The version.txt now looks like this:

<<<<<<< HEAD:app/views/common/version.txt
v1.4-alpha-02
=======
v1.4-alpha-01
>>>>>>> new version, new branch:app/views/common/version.txt

So, I tidy it up and it looks like this now:

v1.4-alpha-02

and then I tried to carry on: at first I try a commit:

> git commit -a -m "merged"
# Not currently on any branch.
nothing to commit (working directory clean)

No luck there. So, I was trying to add the file:

git add app/views/common/version.txt

No response. No news is good news, I guess. So, I try to continue:

> git rebase --continue
Applying: new version, new branch
No changes - did you forget to use 'git add'?

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

It’s at this point, after going round and round with this, that I’m banging my head off the desk.

What’s going on here? What am I doing wrong? Can anyone set me straight?

EDIT – for unutbu

I changed the file as you suggested and get the same error:

> git rebase master
First, rewinding head to replay your work on top of it...
Applying: new version, new branch
error: patch failed: app/views/common/version.txt:1
error: app/views/common/version.txt: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging app/views/common/version.txt
CONFLICT (content): Merge conflict in app/views/common/version.txt
Failed to merge in the changes.
Patch failed at 0001 new version, new branch

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:01:59+00:00Added an answer on May 20, 2026 at 12:01 am

    I encountered a similar problem with a rebase. My problem was caused because one of my commit only changed a file, and when resolving, I discarded the change introduced in this commit. I was able to solve my problem by skipping the corresponding commit (git rebase --skip).

    You can reproduce this problem in a test repository. First create the repository.

    $ mkdir failing-merge
    $ cd failing-merge
    $ git init
    Initialized empty Git repository in $HOME/failing-merge/.git/
    

    Then commit the original content of version.txt in master.

    $ echo v1.4-alpha-02 > version.txt
    $ git add version.txt
    $ git commit -m initial
    [master (root-commit) 2eef0a5] initial
     1 files changed, 1 insertions(+), 0 deletions(-)
     create mode 100644 version.txt
    

    Create the v4 branch and change the content of version.txt.

    $ git checkout -b v4
    Switched to a new branch 'v4'
    $ echo v1.4-alpha-03 > version.txt
    $ git add version.txt
    $ git commit -m v4
    [v4 1ef8c9b] v4
     1 files changed, 1 insertions(+), 1 deletions(-)
    

    Go back to master and change the content of version.txt so that there will be a conflit during the rebase.

    $ git checkout master
    Switched to branch 'master'
    $ echo v1.4-alpha-04 > version.txt
    $ git add version.txt
    $ git commit -m master
    [master 7313eb3] master
     1 files changed, 1 insertions(+), 1 deletions(-)
    

    Switch back to v4 branch and try to rebase. It fails with a conflit in version.txt as planned.

    $ git checkout v4
    Switched to branch 'v4'
    $ git rebase master
    First, rewinding head to replay your work on top of it...
    Applying: v4
    Using index info to reconstruct a base tree...
    Falling back to patching base and 3-way merge...
    Auto-merging version.txt
    CONFLICT (content): Merge conflict in version.txt
    Recorded preimage for 'version.txt'
    Failed to merge in the changes.
    Patch failed at 0001 v4
    
    When you have resolved this problem run "git rebase --continue".
    If you would prefer to skip this patch, instead run "git rebase --skip".
    To restore the original branch and stop rebasing run "git rebase --abort".
    $ cat version.txt
    <<<<<<< HEAD
    v1.4-alpha-04
    =======
    v1.4-alpha-03
    >>>>>>> v4
    

    We resolve the conflict by selecting the master content of version.txt. We add the file and try to continue our rebase.

    $ echo v1.4-alpha-04 > version.txt
    $ git add version.txt
    $ git rebase --continue 
    Applying: v4
    No changes - did you forget to use 'git add'?
    If there is nothing left to stage, chances are that something else
    already introduced the same changes; you might want to skip this patch.
    
    When you have resolved this problem run "git rebase --continue".
    If you would prefer to skip this patch, instead run "git rebase --skip".
    To restore the original branch and stop rebasing run "git rebase --abort".
    

    It fails ! Let’s see what changes git think there is in our repository.

    $ git status
    # Not currently on any branch.
    nothing to commit (working directory clean)
    

    Ah ah, there is no change. If you read in detail the previous error message, git informed us of this and recommended to use git rebase --skip. He told us “If there is nothing left to stage, chances are that something else already introduced the same changes; you might want to skip this patch.” So we just skip the commit and the rebase succeed.

    $ git rebase --skip
    HEAD is now at 7313eb3 master
    

    Word of caution: Please note that git rebase --skip will completely drop the commit that git tried to rebase. In our case, this should be okay since git is complaining this is an empty commit. If you think you’ve lost changes once the rebase is complete, you can use git reflog to get the commit id of your repository before the rebase, and use git reset --hard to get your depot back in that state (this is another destructive operation).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a branch called experiment. git checkout master echo 'some changes' > a.txt
I've read this book section about git branches. I have create a branch called
Say I have a git repository and I've been working on master, can I
It's possible that I'm not really understanding how git works here, but I have
Here's the scenario: I have a local git repository that mirrors the contents of
It's possible that I'm not really understanding how git works here, but I have
I'm a git newbie and I keep reading about a master branch. Is master
I have made a bare repository (MY_LOCAL_REP) out of a public git repository hosted
It seems like I have inadvertently modified my git config such that when I
I'd like to have a git repository with a branch for development and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.