Removing winmerge from git - windows

I have a Windows 7 computer at work that someone else used before I joined the company. They have git setup with winmerge. While it may be a good idea, I want to remove it and return to a basic "default" git installation.
I tried uninstalling git and gitextensions (which I found on the computer) and after the restart I reinstalled git. I still see the same winmerge options when I do git config --list.
Here is a screenshot of what it is telling me. How would I restore this computer to a default install without winmerge? Thanks in advance!
Screenshot from git config --list
Or here is the code (not that "$REMOTE" is from the previous line)
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
merge.tool=DiffMerge
diff.guitool=winmerge
credential.helper=!\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\"
difftool.winmerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe
difftool.winmerge.cmd="C:/Program Files (x86)/WinMerge/winmergeu.exe" -e -u "$LOCAL" "$REMOTE"
mergetool.DiffMerge.path=C:/Program Files (x86)/WinMerge/winmergeu.exe`

Like #AndrewC said in the comments, you can delete the .gitconfig file found in your user profile (C:\Users\User\.gitconfig).
Alternatively, you can do git config --global --edit and manually delete the lines from the file opened.

Related

How to fix git commit on windows: "Waiting ... to close ... file: ... vim.exe: C:/Program: No such file or directory"

Does anyone know how to fix this error? Everything worked fine a few days ago in this same repository. Now that I'm trying to commit new changes, I get this error that I cannot fix. As far as I know, nothing has changed except for some Windows updates from patch Tuesday.
$ git commit
hint: Waiting for your editor to close the file... C:/Program Files/Git/usr/bin/vim.exe: C:/Program: No such file or directory
error: There was a problem with the editor 'C:/Program Files/Git/usr/bin/vim.exe'.
Please supply the message using either -m or -F option.
$ git config --global core.editor
C:/Program Files/Git/usr/bin/vim.exe
I've upgraded git for windows to the latest, but that didn't help. The error doesn't make any sense; vim runs fine. It says that git is waiting for vim to close "C:/Program", but that sounds like git passed vim a full path but forgot to escape the space. How could that happen?
You need to fix quotes in your .gitconfig:
git config --global core.editor "'C:/Program Files/Git/usr/bin/vim.exe'"

Git (windows); P4merge as mergetool error

I've tried setting up p4merge as my mergetool, but I can't seem to get it working. Here's my commands:
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path "C:/Program Files/Perforce/p4merge.exe"
git config --global mergetool.p4merge.cmd "p4merge.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\""
And here's the error I'm getting:
I've also tried installing a portable version of git and running the commands from a windows cmd prompt and I still get a similar error.
Any ideas here? I'm stumped.
Edit
Strangely enough, after I've set up p4merge via git bash and it failed, I tried merging in Visual Studio's Team Explorer and it launched p4merge (tableflip). I imagine the command that kicks off via VS is similar to git bash, but I'm not sure how to correlate the two.
Edit 2:
Here's my git status showing my merge conflict status:
First, try those same config command form a regular cmd session (as I mentioned in "escape double quotes in git config from cmd").
Just make sure you have unzipped the latest git-for-windows
(PortableGit-2.8.3-64-bit.7z.exe) in, for instance, C:\git, and added C:\git\bin to your %PATH%.
Second make sure you have files that need merging, ie. that have unresolved merge conflicts (with merge conflict markers in them), in order for git mergetool to work.

Git config values clash

I ran into big git configuration problem on my windows laptop. I downloaded Git for Desktop since I wasn't able to install git lfs to my cygwin git. I then removed the git from cygwin. I have a GitHub project which is using git-lfs for storing
large files. When I clone the project and it starts downloading files from the remote server it says:
WARNING: These git config values clash:
git config "http.sslcainfo" = "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt"
git config "http.sslcainfo" = "/ssl/certs/ca-bundle-ghfw.crt"
Neither of those file locations exist on my computer. When I use git config --list I can see both values for http.sslcainfo. But the mingw one is not listed in with any of the git config --system --list, git config --global --list or git config --local --list. So I can't locate the file where
configuration is. I assume the Git for Desktop wants to use the /ssl/certs/ location since it sets it to git config --system when it is installed. I also have installed mingw on my computer but I couldn't find .gitconfig file inside it. Also I don't know why git would even look from there or where the configurations might be saved. I'm able to clone repository which doesn't use git-lfs. So is there any way to remove the http.sslcainfo = "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt" configuration? Any help will be highly appreciated.
first of all, i have to tell you that im not sure if i can help you. However, i want to share my information with you.... maybe it helps. I am tying out git-lfs for some big repos at the moment. I am using the bitbucket test server. Atleast on bitbucket, they say that files from git lfs are downloaded via HTTPS and need an ssl cert.
I hope that this helps you a bit. If you got more questions about this, feel free to ask.
Frossy

warning: templates not found /usr/local/git/share/git-core/templates

I get this error warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository this link, this link, and this link I tried this method and I just waiting more than 20 minutes but repo doesn't clone. I use source-tree and OS X El Capitan. How can I fix it?
Create a templates folder.
In your case, it should be: mkdir /usr/local/git/share/git-core/templates
I was also getting same error
warning: templates not found /usr/local/git/share/git-core/templates when I cloning repo in local repository then i found solution which solved my issue.
I Added the [init] section to .gitconfig in home directory, so that it looked at SourceTree's git templates directory when cloning a repo:
[init]
templatedir = /Applications/SourceTree.app/Contents/Resources/git_local/share/git-core/templates
Hope it will help you!.
In case of Source tree on macOS
Steps:
Source tree Menu
Preferences
Git
Click on System Git under Embedded Git Version 2.2.1
Reset to embedded Git
Restart source tree
Similar to Rohit's answer, I went into SourceTree's Tools->Options->Git and selected "Update Embedded Git". After the latest Embedded Git version was installed, the warning stopped occurring.
Cloning via SourceTree for Mac, the download was stuck at 99% and I was getting the same error:
warning: templates not found /usr/local/git/share/git-core/templates
I started looking up the issue and found this Question. Was about to start with some of the Answers here...
But then it finally completed. So, my Answer: wait a bit longer. Mine was cloning for 10 minutes or so.
#wonderfulthunk's comment works for me:
sudo mkdir -p /usr/local/git/share/git-core/templates && sudo chown -R my_username /usr/local/git
I followed below steps and I am able to get through this issue in Windows 10.
Step1:
First know the path of %USERPROFILE% using below command in command prompt.
echo %USERPROFILE%
Please note that, you can also run git config --list and look for init.templatedir for the path.
Step2:
Look for .git_template folder in it.
If is missing, please run below command to add it.
git config --global init.templatedir "%USERPROFILE%.git_template
Step3:
Create a folder namely templates in it.
After creating this templates folder, I did not get the warning mentioned i.e. 'templates not found' any more.
MacOS: Ventura 13.0 /
Sourcetree: 4.2.0
I fixed warning: templates not found /usr/local/git/share/git-core/templates by going to "Sourcetree preferences -> Git" and clicking to "Use System Git". There's no need to restart Sourcetree, just try to clone again.
I didn't switch to usage of embedded Git again, all works perfectly with usage of System Git.
In my case, this happened because an unaccesed project. Check that you have all the privileges to clone that repository.
If you use Sourcetree application, switch git version from "Embedded Git" to "System Git" in setting.
https://community.atlassian.com/t5/Bitbucket-questions/About-git-path-for-Sourcetree/qaq-p/186483
And after changing git version, if you still have problem with cloning, change protocol from "ssh" to "https".
I couldn't get past this problem. Even after getting rid of the 'templates not found' error by adding the usr/local/git... folder, the clone would still look like it was at 99% and sit there for HOURS. I just clone via command line and it's there in seconds, then I just add the local repo to Sourcetree instead.

`git add` doesn't add files to track on Windows

I have a local folder which I wanted to convert to a Git repository and then push to a remote repository. I ran the command git init in the project folder and then used the command git add .. When I run the command git status, I get the message that I have untracked files. I ran the git add . command multiple times but I see the same message.
What should I do to track these files so I can push to a remote repo?
I'm using Windows 8.1 x64 machine.
UPDATE: Please see the answer below.
I used the command git config --system core.longpaths true to fix the error for longer file names. I was able to add all files after making that change.

Resources