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

  • SEARCH
  • Home
  • 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 6913813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:15:55+00:00 2026-05-27T09:15:55+00:00

Until yesterday my project has only a branch with a .gitignore file similar to:

  • 0

Until yesterday my project has only a branch with a .gitignore file similar to:

*.log
upload/*
!upload/global/empty.txt

It worked fine until I added a new branch and changed this .gitignore to not ignore upload files. The new .gitignore file remained with only one line:

*.log

I returned to master branch without problems, but now each time I want to go to the new branch I receive a message like this:

error: Untracked working tree file ‘upload/file.txt’ would be
overwritten by merge.

I need to checkout this branch to work with it or, at least, rescue the commits I made.

Note: I’ve found this similar question, but doesn’t answer my question.

  • 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-27T09:15:56+00:00Added an answer on May 27, 2026 at 9:15 am

    Your issue is that in the new branch you are not tracking upload/file.txt but you are tracking it in your master branch. So when you switch to your new branch, your version, from master, will overwrite the untracked file.

    Add the -f flag, to your git checkout, to force git to overwrite the untracked file.

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

Sidebar

Related Questions

I'm sure my app worked right until yesterday, when I got this error: Failed
i have a Magento site in which the checkout process worked fine until yesterday
I'm developing a service using .NET on Windows platforms. It had worked until yesterday...
My code which was working until yesterday, all of a sudden has started throwing
I'm requesting the installed drive apps. This worked fine until yesterday. Today I get:
My Xcode is configured for iPhone dev, and it worked well until yesterday. But
I am on LAMP with Alternative PHP Cache (APC). It worked fine until yesterday
Until yesterday everything was normal but today i try to lauch my application using
Until yesterday everything was fine to my localhost, but starting yesterday, localhost is not
Up until yesterday (June 20, 2012) my application was running smoothly. As of yesterday,

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.