Skip to content

Instantly share code, notes, and snippets.

@mikemichaelis
Last active March 7, 2017 13:39
Show Gist options
  • Save mikemichaelis/d3ebef4d73fa49e04cfb156b3b7a5854 to your computer and use it in GitHub Desktop.
Save mikemichaelis/d3ebef4d73fa49e04cfb156b3b7a5854 to your computer and use it in GitHub Desktop.
FIRST:
On Windows with $HOME mapped to a network drive, global .gitconfig can exist in multile places.
When using the Windows command shell, batch scripts or Windows programs, the file will be read from:
%USERPROFILE%\.gitconfig
However, when you're using Gi msys (bash) this will be read from
$HOME/.gitconfig
Make symbolic links to .gitconfig on Network drive:
1. cd C:\Users\[USER]
2. mklink .gitconfig S:\.gitconfig
THEN:
-- If in a enterprise environment, be sure to use your Exchange Full Name & email
git config --global user.name "{First} {Last}"
git config --global user.email "{email}"
git config --global mergetool.keepBackup false
-- if you want to use p4merge as the command line git merge/diff tool
-- https://gist.github.com/dgoguerra/8258007
git config --global mergetool p4merge
git config --global difftool p4merge
NOTE
The above last command will not work on Windows.It is an issue with the Windows command line (or bash on Windows, or PS)
either replacing the env parameters or escaping the double quotes.
You will need to manually edit your .gitconfig file and correct the parameters to be as such
[difftool]
p4mergetool = p4merge "$LOCAL" "$REMOTE"
Notes: make sure p4mergetool is in you path
-- if you want to use notepadd++ as the command line git text editor
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment