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 3786884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:45:11+00:00 2026-05-19T11:45:11+00:00

I will preface this by saying that I am pretty new to git. However,

  • 0

I will preface this by saying that I am pretty new to git. However, this seems like a pretty straightforward scenario, and I can’t see where the problem is coming from. Here is the scenario:

I am on the master branch with some uncommitted changes that I don’t want. I need to make a separate simple change to be packaged into a patch. So I do this:

I find the hash # for the last commit to the master branch which is ffdd99afc89211e9ddc3efa3415b0adaf0076b4b.

So from the root of my repository I do:

git branch my_patch ffdd99afc89211e9ddc3efa3415b0adaf0076b4b
git checkout -f my_patch

Now I edit three files and add a fourth after which I do:

git add [path to the added file]
git status

this lists the three updated and one added file

git commit -a
git status

no changes found

git format-patch master --stdout > my_patch.patch

All is good to this point. Now I want to merge this branch back into master.

git checkout master
git status

No changes found

git merge my_patch

The output from which is:

Updating ffdd99a..e2754ca 
error: Your local changes to 'Blah.cs' would be overwritten by merge. 
Aborting. Please, commit your changes
or stash them before you can merge.

And now if I do git status I get a boat load of changes listed. Does this make any sense to anyone?

  • 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-19T11:45:11+00:00Added an answer on May 19, 2026 at 11:45 am

    if you don’t want the changes when you start, do a git reset --hard. And if there are untracked files there that you don’t want do a git clean -df as well.

    As for your error message at the end, you may have an issue with casing in the path. Is this on Windows w/ msysgit?

    If you are on windows, ensure you have autocrlf set to false.

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

Sidebar

Related Questions

No related questions found

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.