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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:14:58+00:00 2026-06-10T17:14:58+00:00

I have this on my .gitignore file: /nbproject/ /app/runtime/ /app/runtime/application.log* /app/runtime/error.log* /app/config/localdev.php* .DS_Store 1)

  • 0

I have this on my .gitignore file:

/nbproject/
/app/runtime/
/app/runtime/application.log*
/app/runtime/error.log*
/app/config/localdev.php*
.DS_Store

1)
I have checkout to master branch and then, checkout again, back to dev branch.

2)
Once I got back to dev branch, I lost all /nbproject/ files and all /app/config/localdev.php as well !!!
And perhaps the others, but since they are autogenerated by php framework uppon runtime, I can’t really tell!

3)
I then switch back to the master branch and I got those files there.

4)
I’ve copy those files somewhere else, and I’ve switched to dev branch again.

5)
I’ve place those missing files back inside /nbproject/ folder.

Now, if I try to switch to the Master branch, I’m getting this:

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

I’m aware that I should perhaps do a git add . to move those files on the repository, what I don’t understand is:

Why is git throwing this message IF I had nbproject/ ignored well before those git checkout commands being issued?

Question:

The point is to ignore those files. Both on master and dev. My question is: how can I fix this in order to:

a) First:
get those files (the ones on gitignore) back to dev ?

b) Second:
make steps to avoid this conflict 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-10T17:15:00+00:00Added an answer on June 10, 2026 at 5:15 pm

    Steps taken to solve the problem.
    Credits go to: jszakmeister

    1) I have cloned the project to somewhere else.

    2) I’ve checkout master on that clone.

    3) Placed the gitignore into the master as it should have been there from the beginning:
    git show dev:.gitignore > .gitignore

    4) I’ve removed the files from the tree by doing git rm “all files that where on gitignore one by one”

    5) I’ve added the .gitignore file to the repo.

    6) commit it

    7) switch back to the original repo and did:

    8) git fetch /path/to/fix-project master:master

    9) git checkout master, and I got:
    Switched to branch ‘master’
    Your branch is ahead of ‘hub/master’ by 1 commit.
    this is my remote master branch.

    10) Pushed to remote master.

    11) checkout dev again

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

Sidebar

Related Questions

I have the following .gitignore file # file named .gitignore system/application/config/database.php system/application/config/config.php system/logs modules/recaptcha/config/*
part of my gitignore file looks like this: phoenix/config/ProjectConfiguration.class.php StatsFile.txt phoenix/StatsFile.txt phoenix/config/* phoenix/config/propel.ini phoenix/data/*
this is probably naive question: i have file config.yml which is in .gitignore file
I have the following .gitignore file *.pyc project/app/dist/* project/bin/* project/etc/* project/var/* !README.txt So far
I have a .gitignore file in a few directories (ex. log/ ) with the
I have a .gitignore file in my repo. #DB Ignore db_connect.php #Environment Banner template.php
Using the GitHub application on Mac (not the cli), I have this error which
I have a PHP config file i'd like to manipulate locally but ignore those
I have this application where I implement the ActionBar Fragment interface. Underlying the interface,
I have read this manual: http://git-scm.com/docs/gitignore As I am working with gitosis, I rather

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.