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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:46:12+00:00 2026-05-28T05:46:12+00:00

I have a git repo at the workspace level. i.e. multiple closely related Eclipse

  • 0

I have a git repo at the workspace level. i.e. multiple closely related Eclipse projects in one repo.

If I add .metadata to .gitignore then each time I create new branch and checkout I loose my .metadata file and therefore import all the projects manually. This is unpleasant.

Is it safe to store the .metadata file under version control? This is a multi-developer project and JDK versions and perhaps even OSs (in future) may vary. (We’re all on Ubuntu at present.)

Are there any other IDE files which shouldn’t be comitted?

Thanks,

Chris.

  • 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-28T05:46:13+00:00Added an answer on May 28, 2026 at 5:46 am

    The problem is that the file and/or directory was already tracked by git before you added it to .gitignore:

    • for a file, it will continue to be tracked, no matter what;
    • for a directory, files present in this directory at the time you added it to .gitignore will also be tracked.

    This means, among others, that if you have a file f which is untracked in branch b1 but you checkout branch b2 in which this file is tracked, git will remorselessly overwrite f.

    As mentioned in the previous question, the solution to make git completely ignore such files after “the harm is done” consists of issuing git rm -r --cached and only then adding them to .gitignore. But this needs to be done branch by branch, which means you will still have the problem in the meantime.

    Given your situation, you have two choices:

    • if you can afford to restart “from scratch”, do so and put .metadata immediately into .gitignore — and commit that first, before even committing the rest;
    • if you cannot afford that, you have no choice but a git filter-branch.

    As to other files to ignore with other IDEs, I can only tell for IDEA: .idea and *.iml. No idea for others…

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

Sidebar

Related Questions

I have an eclipse workspace with a bunch of projects from git, I am
I have a git repo and I want to add a submodule to it.
I have a git repo in /foo/bar/baz with a large commit history and multiple
I have cloned a project from a git repo into eclipse Helios using the
I have a git repo, and a revision code I want it to get
I have a git repo which has a few branches - there's the master
I have a git clone/repo on a development server, but I am now moving
I have a a remote git repo and a local clone. Let's say I
I have created a bare git repo (lets call it repo #1) and cloned
In my git repo which is tracking a svn repo I have made 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.