Tag: whitespace

git repo in Dropbox, syncing on Linux and Windows, Whitespace issues

I have a git repo in my Dropbox, that syncs between a Linux and a windows machine. I work on both machines on text files (.cpp on linux and win, .tex/.txt on win). So, my editors and programs both write CRLF (the win programs) and LF (the linux programs) files, all programs understand all variants […]

How to change tab width in git diff?

This question already has an answer here: setting tabwidth to 4 in git show / git diff 2 answers

Git unstage lines where the only changes is white-space?

I have a source code file that for some reason have ended up with mixed indentation (spaces and tabs used for indentation). I have made quite a few changes and now I wish to commit those changes in git. Unfortunately I by accident instructed my editor to fix all indentation. So now it looks like […]

`git difftool` and witespaces in namefiles

It seems that when git difftool executes an external command, it does not quote the arguments correctly. If .gitconfig contains the following lines: [difftool.echo] cmd = echo “$LOCAL” “$REMOTE” When I try to run difftool with a path containing spaces, such as > git difftool -t echo HEAD^ HEAD spaces\ here/test.txt I get the following […]

SourceTree merge ignore whitespace conflicts

Is there a way to tell SourceTree to always ignore whitespace “conflicts” during merges? Something like the command-line call: git merge -Xignore-space-change as described at Merging without whitespace conflicts.

exclude Jest snapshots from git whitespace check

I am trimming whitespace from git commits using git diff-index –check –cached HEAD –. I want to add Jest tests using snapshots, but the snapshot files include whitespace and my tests will always fail if I remove it. So I want to exclude the *.js.snap files from the whitespace check. How do I tell git […]

GIT complains about randomly changed files when switching branches

Starting from git status # On branch master nothing to commit, working directory clean and then switching to another branch git checkout somebranch after switching to a new branch and running a git status git will sometimes complain about randomly changed files. If i diff the files with git diff it will display the whole […]

git-add only whitespace changes?

The style of my project does say to trim trailing whitespace, but this makes diffs very, very messy. I like to consolidate them to one commit before I commit the actual fix. This is closely related to Add only non-whitespace changes, but it is asking the exact opposite: Is there a way to add only […]

Can CVS and Subversion be set to ignore whitespace in merging?

CVS and Subversion both have a handy merge feature so that when you update a source file that you have modified, it merges in changes that others have made on the same file. However, if your changes and the other ones are incompatible – generally if you have both changed the same parts of the […]

Git rebase for a branch created days back

I need help in understanding git rebase for this situation. I checked out a branch created by some one 10 days back. I checked out using git checkout -b <some name> origin/branchname (I just used different name to identify it) After checkout, if I do rebase by being in this checked out branch, git rebase […]

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