Re: About checkout with untracked files on remote.
- From
- Eugene 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 =)