git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: About checkout with untracked files on remote.

From
EFEugene Fedorov <jek.fdrv@gmail.com>
Date
Feb 25, 2015, 19:45 UTC
Message-ID
<DEA06477-4036-4941-A0C6-CF3D5DB15C96@gmail.com>
In-Reply-To
<F195C0CF-55E5-40AE-B5E1-7CA6D46DF3A6@gmail.com>
I have specific case which you can use to improve git.

My example: I have 2 branches - master, implement_button. Branch implement_button add some button with few style.css and fonts files. Both branches have same git ignore file where all fonts and css folders with files ignored.

The point: Now my active branch is implement_button. 1 Try to checkout to remote master branch and get error: error: The following untracked working tree files would be overwritten by checkout: css/style.css css/fonts/RobotoSlab-Bold-webfont.eot Please move or remove them before you can switch branches. Aborted.

So we have case where master haven’t new ignored files. We can’t use "git clean -df" bc it not clean untracked files. Bc implement_button branch it is not untracked. I can’t use "git clean -dfx» bc i need some another ignored files. I can’t use force checkout bc i need this files be deleted. Also i can’t get this error without run checkout, so or i will be checkout or error. Dry-run not work for this command. http://stackoverflow.com/questions/28714372/how-to-catch-git-error-on-checkout-without-checkout/28714462#28714462

So i need help understand how i can do this? Parse rendered error to get the list of files to drop and drop them? Hope i can do this in another way =)

P.S. Thank you very much for try help me =)
Message 1 of 1 in “Re: About checkout with untracked files on remote.”
  1. Eugene FedorovFeb 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.