{"thread":{"id":"20516","subject":".gitignore vs untracked working file","startedAt":"2009-08-10T09:57:15Z","lastAt":"2009-08-10T13:49:39Z","messageCount":7,"participants":["Rostislav Svoboda","Uwe Kleine-König","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"120135","messageId":"286817520908100257n35b178ebu387161658554b4a@mail.gmail.com","threadId":"20516","inReplyTo":null,"subject":".gitignore vs untracked working file","fromName":"Rostislav Svoboda","fromEmail":"rostislav.svoboda@gmail.com","sentAt":"2009-08-10T09:57:15Z","receivedAt":"2009-08-10T09:57:15Z","isPatch":false,"sender":{"key":"rostislav.svoboda@gmail.com","avatar":"https://gravatar.com/avatar/9486d31c83feb25557c616b462aaef410dfe21d03bdf08cb62ff4ba9bafcc8eb?d=mp&s=160"},"body":"Hi\n\nI have a .gitignore rule to ignore everything in bin/ directories but\nI cannot change branch because of a file lying in a bin/ directory\nwhich actually should be ignored. What am I doing wrong?\n\n$ git branch\n  master\n* mybranch\n\n$ git status\n# On branch mybranch\nnothing to commit (working directory clean)\n\n$ cat .gitignore\n*.class\n.cvsignore\nCVS/\n.metadata/\nbuild/\nbin/\n.#*\n\n$ git checkout master\nerror: Untracked working tree file 'Project/bin/path/file.jjt' would\nbe overwritten by merge.\n\n$ git --version\ngit version 1.6.4.msysgit.0\n\n\nthx\n\nBost\n"},{"id":"120136","messageId":"20090810100148.GB22200@pengutronix.de","threadId":"20516","inReplyTo":"286817520908100257n35b178ebu387161658554b4a@mail.gmail.com","subject":"Re: .gitignore vs untracked working file","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-08-10T10:01:48Z","receivedAt":"2009-08-10T10:01:48Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\n> $ git checkout master\n> error: Untracked working tree file 'Project/bin/path/file.jjt' would\n> be overwritten by merge.\nWhat is the output of\n\n\t$ git ls-files master bin/\n\n?\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\n"},{"id":"120137","messageId":"286817520908100317k4e98faf9n4e852b7abd4719fe@mail.gmail.com","threadId":"20516","inReplyTo":"20090810100148.GB22200@pengutronix.de","subject":"Re: .gitignore vs untracked working file","fromName":"Rostislav Svoboda","fromEmail":"rostislav.svoboda@gmail.com","sentAt":"2009-08-10T10:17:02Z","receivedAt":"2009-08-10T10:17:02Z","isPatch":false,"sender":{"key":"rostislav.svoboda@gmail.com","avatar":"https://gravatar.com/avatar/9486d31c83feb25557c616b462aaef410dfe21d03bdf08cb62ff4ba9bafcc8eb?d=mp&s=160"},"body":"2009/8/10 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n> Hello,\n>\n>> $ git checkout master\n>> error: Untracked working tree file 'Project/bin/path/file.jjt' would\n>> be overwritten by merge.\n> What is the output of\n>\n>        $ git ls-files master bin/\n\nNothing:\n\n$ git ls-files master bin/\n$ git ls-files master Project/bin/\n$ git ls-files mybranch bin/\n$ git ls-files mybranch Project/bin/\n\n$ ll 'Project/bin/path/file.jjt'\n-rw-r--r--    1 bost  Administ     8233 May 10  2006 Project/bin/path/file.jjt\n$ git ls-files ''Project/bin/path/file.jjt'\n\nBTW the rule to ignore bin/ is exclusively in the .gitignore on the\nbranch mybranch not in the master branch. Might this be the problem?\n\nBost\n"},{"id":"120142","messageId":"4A800785.8050909@viscovery.net","threadId":"20516","inReplyTo":"286817520908100317k4e98faf9n4e852b7abd4719fe@mail.gmail.com","subject":"Re: .gitignore vs untracked working file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-10T11:41:57Z","receivedAt":"2009-08-10T11:41:57Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Rostislav Svoboda schrieb:\n> 2009/8/10 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n>> Hello,\n>>\n>>> $ git checkout master\n>>> error: Untracked working tree file 'Project/bin/path/file.jjt' would\n>>> be overwritten by merge.\n>> What is the output of\n>>\n>>        $ git ls-files master bin/\n> \n> Nothing:\n\nIt should have been\n\n\t$ git ls-tree master bin\n\n> BTW the rule to ignore bin/ is exclusively in the .gitignore on the\n> branch mybranch not in the master branch. Might this be the problem?\n\nIt might be, depending on how precious Project/bin/path/file.jjt is for\nyou. Try this:\n\n\t$ git checkout -f master\n\nThis will overwrite the existing file with the version from master. If you\nlater\n\n\t$ git checkout mybranch\n\nthen the file will be *removed*.\n\n-- Hannes\n"},{"id":"120146","messageId":"286817520908100559u6cdcaab0u3a7fdb92cd43eed9@mail.gmail.com","threadId":"20516","inReplyTo":"4A800785.8050909@viscovery.net","subject":"Re: .gitignore vs untracked working file","fromName":"Rostislav Svoboda","fromEmail":"rostislav.svoboda@gmail.com","sentAt":"2009-08-10T12:59:57Z","receivedAt":"2009-08-10T12:59:57Z","isPatch":false,"sender":{"key":"rostislav.svoboda@gmail.com","avatar":"https://gravatar.com/avatar/9486d31c83feb25557c616b462aaef410dfe21d03bdf08cb62ff4ba9bafcc8eb?d=mp&s=160"},"body":"2009/8/10 Johannes Sixt <j.sixt@viscovery.net>:\n> Rostislav Svoboda schrieb:\n>> 2009/8/10 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:\n>>> Hello,\n>>>\n>>>> $ git checkout master\n>>>> error: Untracked working tree file 'Project/bin/path/file.jjt' would\n>>>> be overwritten by merge.\n>>> What is the output of\n>>>\n>>>        $ git ls-files master bin/\n>>\n>> Nothing:\n>\n> It should have been\n>\n>        $ git ls-tree master bin\n\nMerde!\n\n$ git ls-tree master Project/bin/path/file.jjt\n100644 blob 8d5e24f12c37fd1a435de2d4402591f5b0c2a3cc\nProject/bin/path/file.jjt\n\nThere's a file.jjt in the repo already! But guys! I bet I'm not the\nfirst one having this problem. Do you think it would be wise to have a\nkind of a check returning\n    'The file '...' ignored in the branch X is not ignored in the\nbranch Y (or something)'\n\ninstead of responding questions like mine over and over again?\n\nBost\n\nPS: ... and yea, thx a lot!\n"},{"id":"120147","messageId":"4A801D48.3020902@viscovery.net","threadId":"20516","inReplyTo":"286817520908100559u6cdcaab0u3a7fdb92cd43eed9@mail.gmail.com","subject":"Re: .gitignore vs untracked working file","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-08-10T13:14:48Z","receivedAt":"2009-08-10T13:14:48Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Rostislav Svoboda schrieb:\n> $ git ls-tree master Project/bin/path/file.jjt\n> 100644 blob 8d5e24f12c37fd1a435de2d4402591f5b0c2a3cc\n> Project/bin/path/file.jjt\n> \n> There's a file.jjt in the repo already! But guys! I bet I'm not the\n> first one having this problem. Do you think it would be wise to have a\n> kind of a check returning\n>     'The file '...' ignored in the branch X is not ignored in the\n> branch Y (or something)'\n\nThis is not only about ignored files, but untracked files. And the check\nis already there: git said:\n\nUntracked working tree file 'Project/bin/path/file.jjt' would be\noverwritten by merge.\n\n-- Hannes\n"},{"id":"120151","messageId":"286817520908100649j4d369a10p22c667ee077daa47@mail.gmail.com","threadId":"20516","inReplyTo":"4A801D48.3020902@viscovery.net","subject":"Re: .gitignore vs untracked working file","fromName":"Rostislav Svoboda","fromEmail":"rostislav.svoboda@gmail.com","sentAt":"2009-08-10T13:49:39Z","receivedAt":"2009-08-10T13:49:39Z","isPatch":false,"sender":{"key":"rostislav.svoboda@gmail.com","avatar":"https://gravatar.com/avatar/9486d31c83feb25557c616b462aaef410dfe21d03bdf08cb62ff4ba9bafcc8eb?d=mp&s=160"},"body":"> This is not only about ignored files, but untracked files. And the check\n> is already there: git said:\n>\n> Untracked working tree file 'Project/bin/path/file.jjt' would be\n> overwritten by merge.\n\nWell the meaning of the error message is clear to you but it wasn't\nfor me. I simply would not ask if I knew how to correctly interpret\nit. I hope I'll have a time to make a little improvement here...\n\nBost\n\nPS: ...and you can reject it if you don't agree :-)\n"}]}