Git instaweb: The browser is not available - macos

I'm trying to setup git instaweb to open in Chrome. I have set the default browser like so:
git config --global web.browser chrome
This change is reflected in my global .gitconfig, and the git-web--browse documentation says that chrome is available as something to pass in.
When I run git instaweb this is what I get:
The browser chrome is not available as 'chrome'.
http://127.0.0.1:1234
I have also tried google-chrome and the same results happen. How can I set the web browser to actually open in chrome?
Running OSX 10.8.2

Maybe it needs a solution similar to How can I configure git help to use Firefox?:
git config --global web.browser ch
git config --global browser.ch.cmd "open -a Google Chrome.app"
The OP MishieMoo reports you need the full path:
git config --global browser.ch.cmd "open -a \"/Applications/Google Chrome.app\""
Without the absolute path, it was trying to open Chrome.app in my current directory (which was not Applications)

Related

Using git in windows over sshd - stuck in push

In my environment, I cannot log in to the Windows GUI, but I have to use sshd to get a console (cmd.exe) from windows server 2019. Git is installed, but as soon as I try to do a git push, I face a problem:
Usually, in a CMD Console in Windows, a window with the credential manager would pop up, which doesn't work for this use case, where I actually "ssh-ed" via putty to a windows server. It seems that git gets stuck, obviously wanting to open a window.
How can I turn off this behavior, and make git on Windows more "unix-ish", so that like in a Linux environment the username/password prompt appears on the console?
Try and disable the credential helper (in your SSH session)
git config credential.helper=
That will allow you to test if Git is asking for credentials on the command line instead of opening a popup.
Note that this is only if you are cloning HTTPS URL.
Alternative option:
cd path/to/repo
git config --system --unset credential.helper
git config --global --unset credential.helper
git config --unset credential.helper

Git "add --patch" is not working

When I type git add --patch on my Windows 10 machine in the terminal, I get the error:
git: 'add--interactive' is not a git command. See 'git --help'.
I've googled to no avail, all other problems seem to be people running into this issue using other software or on Linux. Any tips?
This thread (for Git on Linux) mentioned the lack of a git-perl package.
But that should not be the case on Windows.
For testing, download PortableGit-2.17.0-64-bit.7z.exe and uncompress its content anywhere you want.
Then setup a simplified PATH:
set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\
In that CMD session, try again your git add -p command.

Changing Git core editor to Notepad++ causing issues

I use Windows 10 and a while back I changed the default Git editor to Notepad++
Now whenever I execute a command that brings up the editor I can't find any way of saving the message & continuing with the command - I end up having to cancel i.e. CTRL + C
I don't have to have Notepad++ as the editor but I do need to be able to use Git properly.
What I've tried
Restoring the original editor (I wasn't able to find out how)
Finding a similar problem on Stack Overflow
Restoring the original editor (I wasn't able to find out how)
You can try:
cd /path/to/your/repo
git config --unset-all core.editor
git config -l|grep core.editor
(grep is available if you add your <git>/usr/bin to the Windows %PATH%.
<git> is the path where you have installed git)
If that does not work, you might have to remove it for your local and global config:
cd /path/to/your/repo
git config --local --unset-all core.editor
git config --global --unset-all core.editor
git config -l|grep core.editor

Store https passwords with cygwin's Git

I am using Cygwin and Git. Every time I push/pull to a repo on Bitbucket with a https url I am asked to enter a password.
Is there a way to store these credentials (like with ssh-keys)?
I tried to install Windows Credential Store for Git but I can't get it to work with cygwin's Git.
Thanks!
Update:
I found my answer here: Is there a way to skip password typing when using https:// on GitHub?
Summarized:
Remember passwords for 15 minutes (default):
git config --global credential.helper cache
Remember passwords for 10 hours:
git config --global credential.helper 'cache --timeout=36000'
Store passwords (didn't try this):
git config --global credential.helper store
Reset:
git config --unset --global credential.helper
Cim
The way OP answered his own question is one way to go about it.
The Windows Credential Store project was discontinued in 2015. Its original author suggests to use Git Credential Manager for Windows, maintained by Microsoft. Their installer is focused on Git for Windows, however the program itself works well with Cygwin, you just have to install it manually.
Go the GCMW's latest release, download the zip file (not the installer), extract its contents (only .dll and .exe files are needed) to C:\cygwin\usr\libexec\git-core\ for 32-bit Cygwin, or C:\cygwin64\usr\libexec\git-core\ for 64-bit Cygwin. Reference
To get git to use GCMW, execute: git config --global credential.helper manager
To get GUI prompts for credentials, execute: git config --global credential.modalprompt true
If you want this to be a per-repository setting, remove the --global option.
I made Windows Credential Store working with cygwin. The only thing that needs to be changed is global ~/.gitconfig file.
Change 'helper' value which can be found usually at the end of the file to the following:
[credential]
helper = !'/cygdrive/C/Users/<YOUR-ACCOUNT-NAME>/AppData/Roaming/GitCredStore/git-credential-winstore.exe'
For an explanation, cygwin simply uses different paths and the value must follow the rules of course.

How do I get Putty to show color coding on git output?

I am using Putty on Windows 7 to connect to a VirtualBox Debian install, but I am unable to get git commands through Putty to show color coding like Git Bash does on Windows. I can get (and configure) normal Putty (ANSI?) coloring for things like files and folders, but I am not seeing anywhere how to configure colors for git command output.
Launch:
git config --global color.ui true
Try git config color.ui true. If you can see colored files & folders, it means your terminal settings are correct, so Git must not be configured to display colors.

Resources