Tag: whitespace

detect tab changes on a repo

Say you have a repo with changes replacing tabs with spaces. I have uploaded one ad-hoc repo $ git clone https://github.com/albfan/whitespace-diff $ cd whitespace-diff $ cat -A file1 text$ ^Ianother text$ ^I^Itext$ $ git checkout HEAD^ $ cat -A file1 text$ ^Ianother text$ ^I text$ If you ask git for changes you get $ git […]

Git commit stalls on trailing whitespace on lines that don't exist

I’m trying to make a commit in Git, but receive the following error: $ git commit -m “Changed model name from Employee to Person for abstraction” * * You have some suspicious patch lines: * * In app/helpers/people_helper.rb * trailing whitespace (line 28) app/helpers/people_helper.rb:28: * trailing whitespace (line 44) app/helpers/people_helper.rb:44: Fine. I’ll remove the whitespace. […]

Git whitespace/line ending

I’m going to give you a simplified version of what happen and where I am right now. I have tried different solution but I’m not even sure where does my problem come from. I made some modification on my branch B which is a fork of the branch A of an upstream repository. Then I […]

Git does not warn about badly written whitespace

I’ve set config of git so that ‘git config –list’ gives following: core.editor=vim core.whitespace=trailing-space,space-before-tab,indent-with-non-tab core.repositoryformatversion=0 core.filemode=false core.bare=false core.logallrefupdates=true But when I want to commit a file whit trailing space or other whitespace problem, it never complains. Don’t know what I can do.

GIT global config for ignore end-of-line white spaces

Even though I have not changed anything in one of file, I am getting one file in modified files list using > git status. When I saw that file using > git diff, it is displaying all lines are removed and all lines (same) are added, but when I use > git diff –ignore-space-change, git […]

How to get rid of bogus changes in git?

I’m a happy user of PortableGit Today I wanted to pull a project changes from GitHub.com repository, so I did git pull. It failed with the following message: error: Your local changes to ‘main.rb’ would be overwritten by merge. Aborting.. I didn’t care about the local changes so I typed git reset –hard HEAD […]

Git add -patch… but ignore whitespace changes

I can’t seem to find a good way to use git add -p but tell git to ignore all whitespace changes. I don’t want to reset my local changes. The situation: I had all my changes locally, and was grouping them into separate commits. Then I experimented with a minifyer, and overwrote all my css […]

Any way in git, to add all files with only whitespace changes to staging?

An update came in from a library we use that, among other things, cleaned up / standardised up newlines at the end of files. As I consider this change a completely safe change, I’d like to be able to automatically say that any file that has a diff like, diff –git a/ExampleFile.cs b/ExampleFile.cs index abcdef..abcd […]

How to remove trailing whitespace changes from a sequence of git commits

I run a project on github, and someone has sent a sequence of around 20 commits as a pull request. The changes are good, but many of the commits also remove lots of trailing whitespace. I agree trailing whitespace is bad, but the project is full of it and this isn’t the place to clean […]

How do I force LF in a Windows git sandbox for a specific file?

One of my project’s third party build steps requires LF line endings in an XML configuration file, regardless of whether the build occurs on Windows, Mac, or Linux. Our git sandboxes use CRLF on Windows, and LF on Mac/Linux for convenience, and our repository is LF. I need just this one file to be LF […]

Git Baby is a git and github fan, let's start git clone.