Git diff -w ignore whitespace only at start & end of lines

For end of line use: git diff --ignore-space-at-eol Instead of what are you using currently: git diff -w (--ignore-all-space) For start of line... you are out of luck if you want a built in solutio... Read More

git - Correctly ignore all files recursively under a specific folder except for a specific file type

@SimonBuchan is correct. Since git 1.8.2, Resources/** !Resources/**/*.foo works.... Read More

linux - How to get the name of the current git branch into a variable in a shell script?

The * is expanded, what you can do is use sed instead of grep and get the name of the branch immediately: branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') And a version using git symbolic-ref, as... Read More

git - How can I stop and start TGitCache.exe gracefully

Open TortoiseGit Settings > Icon Overlays In section "Status cache" select "None" Click OK TGitCache.exe will disappear from the process list. If you need it again, you can turn it on by selectin... Read More

version control - Sparse checkout in Git 1.7.0?

You still need to clone the whole repository, which will have all the files. You could use the --depth flag to only retrieve a limited amount of history. Once the repository is cloned, the read-tree... Read More

How to deal with IntelliJ IDEA project files under Git source control constantly changing?

You can use IDEA's directory-based project structure, where the settings are stored in .idea directory instead of .ipr file. It gives more fine-grained control over what is stored in version control.... Read More

version control - What is the meaning of git reset --hard origin/master?

git reset --hard origin/master says: throw away all my staged and unstaged changes, forget everything on my current local branch and make it exactly the same as origin/master. You probably wanted to... Read More

How to make Git properly display UTF-8 encoded pathnames in the console window?

git has always used octal utf8 display, and one way to show the actual name is by using printf in a bash shell. According to this comment, this works even in a Windows msysgit bash, which does includ... Read More

How to apply a git patch from one repository to another?

If manually editing the patch file is out of the question or infeasible, this can be done with standard options (available in git apply, git format-patch and GNU patch). -p<n> removes n leading dire... Read More

My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)

I had the opposite problem - had to shift the git root to the parent directory (from project/src to project) To my extreme surprise, the following worked!! src$ mv .git ../ src$ cd .. project$ git a... Read More