Tag: whitespace

Emulate git cp, including files with spaces in names

Yes I know that that what I want (git cp a b) approximately equal to cp -R a b git add b However this adds files that aren’t in the repository. The closest I have gotten is cd a git ls-files > ../files.txt cd ../b cat ../files.txt | xargs git add almost works, but there […]

Xcode whitespace screwed up on git rebase

After I do a git rebase, the code lines I have added/modified are indented four spaces or more to the left of the respective code block. This is incredibly annoying and time-consuming to fix, not to mention it makes it unreadable for Objective-C (imagine if I was coding in python…?) Xcode (or whatever, git?) adds […]

Configuration option like 'git -w'

I almost always use ‘git -w’ when viewing diffs or blames. Can I make that the default behavior with a configuration option?

Making `git status` ignore whitespace changes

git status shows me, that few files are modified. But when I execute git diff with any of parameters below, it’s empty. –ignore-space-at-eol Ignore changes in whitespace at EOL. -b, –ignore-space-change Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to […]

Visual studio adding white space on git merge

How do we prevent leading whitespace being added while Visual Studio 2015 touches files when merging branches. Whitespace Shown in Stash Example above is what is show in Stash during pull request.

Reapply commits while ignoring all space changes with Git

I am trying to merge a branch that has a bunch of commits (~20). However the first commit is about re-indenting the whole code properly and all subsequent commits also contain whitespace changes, which I do not want. I am trying to reapply all those commits but I don’t know how to tell git to […]

Ignore space difference in context line when applying git patch

I’m trying to apply patch generated from some git repository. Patch context line looks like this else if ( o is Item ) and in my code it looks like this else if (o is Item) When I apply patch $ git apply -v –check –directory=myroot –ignore-space-change –ignore-whitespace ../patches/0003-some-name.patch it says that error: while searching […]

White space issues with Automated DB configuration script

I am trying to instigate some configuration control tools for our mysql databases. To start with we trained and installed GIT on all dev machines including DBA. I got a php script written that extract the definition of all db, all tables, functions,SP, views, and triggers and puts this is a directory structure. My initial […]

Git: Commit whitespace refactoring without overwriting history

I’m looking to refactor the whitespace / identation mayhem in our project. For that I was using the untabify function in MSVS, which does just what I need. The problem is commiting it using Git, since it shows almost every line last edited by me, which is technically correct, but in this case not the […]

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 Baby is a git and github fan, let's start git clone.