{"thread":{"id":"53467","subject":"How to Not Track .metadata","startedAt":"2020-05-13T23:51:49Z","lastAt":"2020-05-14T00:51:23Z","messageCount":2,"participants":["Mark Wartman","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"397795","messageId":"DD111BBE-F04A-4E44-99FE-5672FF2934B5@gmail.com","threadId":"53467","inReplyTo":null,"subject":"How to Not Track .metadata","fromName":"Mark Wartman","fromEmail":"markwartman1@gmail.com","sentAt":"2020-05-13T23:51:44Z","receivedAt":"2020-05-13T23:51:49Z","isPatch":false,"sender":{"key":"markwartman1@gmail.com","avatar":null},"body":"Hello,\n\nIn a sentence, I cannot get Git to not track a .metadata file.  How would I correct this? \n\nPlease see .txt files as the mail system would not allow me to mail it.\n\nI can say that I did try running: git clean -n\nI realize that the -n is for a dry run but it did not return anything anyway.\n\nI am using:\ngit version 2.10.1 (Apple Git-78)\nOS X El Capitan version 10.11.6  \n\n\nThanks,\n\nMark Wartman\n\n\n\n\n\nI have cloned a repository that a particular .metadata file was pushed too.  This .metadata file seems to be causing me many git conflicts and other issues with Eclipse.\n\nSo lets say I had a folder named rev.  I navigated into the folder rev which there was nothing in there to start with.  I ran the command:\ngit clone https://github.com/BenArayathel/0427Java.git\n\nSo now 0427Java lives inside of rev\n\nThen inside of 0427Java there is folder called usf-batch-workspace\n\nInside of usf-batch-workspace are java projects that I and my fellow batch-mates work on.  I have a .gitignore in all three of: \njava-project, usr-batch-workspace, and 0427Java and all three .gitignore’s are the same.\n\nI suppose hierarchically it might look like:\n\nrev   <---------( regular folder not tracked )\n\t0427Java\n\t\tusr-batch-workspace\n\t\t\tjava-project\n\nInside my .gitignore I have used these:\n\n/.metadata/\n/usf-batch-workspace/.metadata/*\n**/.metadata/*\n\n# Created by https://www.gitignore.io/api/eclipse\n# Edit at https://www.gitignore.io/?templates=eclipse\n\n### Eclipse ###\n.metadata\n\n# as well as the rest of the provided template\n\n\n\n\n"},{"id":"397799","messageId":"20200514005114.GH6605@camp.crustytoothpaste.net","threadId":"53467","inReplyTo":"DD111BBE-F04A-4E44-99FE-5672FF2934B5@gmail.com","subject":"Re: How to Not Track .metadata","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2020-05-14T00:51:14Z","receivedAt":"2020-05-14T00:51:23Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2020-05-13 at 23:51:44, Mark Wartman wrote:\n> Hello,\n> \n> In a sentence, I cannot get Git to not track a .metadata file.  How would I correct this?\n> \n> Please see .txt files as the mail system would not allow me to mail it.\n> \n> I can say that I did try running: git clean -n\n> I realize that the -n is for a dry run but it did not return anything anyway.\n> \n> I am using:\n> git version 2.10.1 (Apple Git-78)\n> OS X El Capitan version 10.11.6\n> \n> \n> Thanks,\n> \n> Mark Wartman\n> \n\n> \n> \n> I have cloned a repository that a particular .metadata file was pushed too.  This .metadata file seems to be causing me many git conflicts and other issues with Eclipse.\n> \n> So lets say I had a folder named rev.  I navigated into the folder rev which there was nothing in there to start with.  I ran the command:\n> git clone https://github.com/BenArayathel/0427Java.git\n> \n> So now 0427Java lives inside of rev\n> \n> Then inside of 0427Java there is folder called usf-batch-workspace\n> \n> Inside of usf-batch-workspace are java projects that I and my fellow batch-mates work on.  I have a .gitignore in all three of:\n> java-project, usr-batch-workspace, and 0427Java and all three .gitignore???s are the same.\n\nI believe your problem is that the .metadata directory is already\ntracked.  A .gitignore file has no effect on files that are already\ntracked.\n\nIf you want to have those files ignored, then you need to remove them\nfirst, by running \"git rm -r --cached usf-batch-workspace/.metadata\" if\nyou want to keep the files locally and without the \"--cached\" if you\nwant to remove them from the working tree as well.\n\nNote that the files will be removed from others' systems when they pull\nthat change into their branches, which is by design.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}