Mittwoch, 24. Februar 2016

Git: Fixing line-ending problem at Windows host system and Linux Guest (Vagrant)

To have the correct line endings in the Linux guest system by working on a Windows host, type the following Git command on the Windows host:

git config --global core.autocrlf true

Dienstag, 16. Februar 2016

git clean - Cleaning the Git repository to be able to merge with remote

Sometimes you get Git messages like

The following untracked working tree files would be overwritten by checkout
The following command can be helpful in that case.

git clean  -d  -fx ""
See http://www.kernel.org/pub/software/scm/git/docs/git-clean.html

-x means ignored files are also removed as well as files unknown to git.
-d means remove untracked directories in addition to untracked files.
-f is required to force it to run.

I've learned this by a discussion on Stackoverflow: http://goo.gl/I9NMxO.