Control characters in git commands

While working on a git-enabled project, it may happen sometimes that you modify a file and then see the changes using git diff or any other command then it shows control characters like “^M“. This may seem annoying.

You can hide it using:

git config core.whitespace cr-at-eol

On the successful completion of the above, commands like git diff and git show will stop showing these characters. But it will do on a per-project basis. If you want to do it globally, do:

git config --global core.whitespace cr-at-eol

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close