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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:36:29+00:00 2026-06-10T19:36:29+00:00

While checkout to master branch, I got: Error: The following untracked working tree files

  • 0

While checkout to master branch, I got:

Error: The following untracked working tree files would be overwritten
by checkout:
nbproject/private/config.properties
nbproject/private/private.properties
nbproject/private/private.xml
nbproject/project.properties
nbproject/project.xml

Please move or remove them before you can switch branches.  

Aborting

So I have remove them (I’ve backup those files somewhere else outside the repo), and I was able to switch again.

The reason I’ve getting this it’s because:

dev is ignoring those files.
master isn’t, because no .gitignore file is present there.

They should both ignore those files.

Plus, when I push this to remote repos, those changes should be propagated for those remote repos as well.

How can we add that .gitignore file to the master, so that this doesn’t happen again ?

  • 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-06-10T19:36:31+00:00Added an answer on June 10, 2026 at 7:36 pm

    Adding a .gitignore file is the same as adding any other file. Create it, and what you want to ignore to it, and then add it and commit it. You can ignore those files specifically with:

    echo /nbproject/private/config.properties >> .gitignore
    echo /nbproject/private/private.properties >> .gitignore
    echo /nbproject/private/private.xml >> .gitignore
    echo /nbproject/project.properties >> .gitignore
    echo /nbproject/project.xml >> .gitignore
    
    git add .gitignore
    git commit -m "Add some ignores."
    

    You’ll likely need to do the same on all your affected branches.

    BUT, you do have something else going on. The fact that git is telling you those files are in the way, isn’t because they’re ignored on your master branch… it’s because they’ve been committed to your master branch. IOW, they are now under version control. I think you need to not only ignore them, but possibly remove them from version control too. That’ll be something you may want to coordinate with your team, so that anyone on master knows the files will be disappearing, and they can back them up beforehand.

    UPDATE: MEM and I chatted about this. We ended up fixing his repository by making another clone, checking out master, adding the .gitignore from his dev branch (via git show dev:.gitignore > .gitignore), and then fetching that revision back into his original project (via git fetch /path/to/fix master:master). Once he had the new revision, we pushed it to the remote, so everyone else would have it too.

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

Sidebar

Related Questions

Permission denied (publickey,keyboard-interactive) got this error while i am trying to cvs checkout from
Getting the following error while trying to do checkout Build errors # [11:27:20]Failed to
I am trying on working on my featureA branch while keeping it up-to-date with
While reset and checkout have different usages most of the time, I can't see
The company that I'm working is working with SVN but I would like to
git status # On branch master # Changed but not updated: # (use git
I am writing wrappers for checkout and checkin. While checkout, I checkout the directory
I'm on the master branch, and want to work on a new feature so
I made a commit while on the (no branch) branch then did a pull,
While I was working on a feature_branch I ended up fixing a bug for

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.