GitBash duplicate taskbar icon
Asked Answered
L

7

7

I've just re-installed Git on my Win10 PC and tried to pin Git Bash to my taskbar.

For some reason now, when I open Bash from my taskbar shortcut, it displays duplicate icon on the taskbar. I tried to pin that icon but once I end the terminal session, that shortcut is deleted. I've tried multiple Win10 sites but most just say to repin the new icon.

Prior to updating I could pin it fine with no issues.

Larimer answered 11/1, 2016 at 0:41 Comment(0)
I
2

Pinning the git-bash.exe fixed the problem for me. This also fixed the problem with broken icon graphic.

NOTE! This was on Windows 7 - haven't tested on Win10!

  1. Open Windows Explorer.
  2. Navigate to C:\Program Files\Git.
  3. Right click git-bash.exe, select Pin to Taskbar.
  4. Shift-right click the newly pinned icon, select Properties.
  5. Add to the end of the field Target: --cd-to-home
  6. Set the value of the field Start in: %HOMEDRIVE%%HOMEPATH%
  7. Press OK.

Git Bash Properties

Introduction answered 14/11, 2016 at 8:41 Comment(1)
More testing reveals problems: I did this on another Win7 computer with the same problem but pinning git-bash.exe did NOT fix the problem this time. I had to pin the opened Git Bash (the duplicated icon) and that one didn't duplicate.Introduction
F
5

I did this for Windows 7:

  1. Make sure there was no other (older) Git Bash appearing in Start Menu
  2. Remove any existing pinned Git Bash from Taskbar
  3. Launch Git Bash
  4. Pin this launched window to Taskbar (instead of the one appearing in Start Menu)
Frodine answered 27/6, 2018 at 16:24 Comment(1)
I just want to say thank you. This helped me solve a different, long-standing issue where my Git Bash icon in the taskbar was missing. Pinning the running instance per your comment, then relaunching it, led to Windows saying it could not find the file and automatically deleting it. Then when I launched Git Bash again the icon loaded normally.Semblance
D
3

NOTE! This was on Windows 10 I don't know how it works but open the git-bash.exe file and pin the opened file on the taskbar Do not pin the program which is not opened or else it wont work enter image description here

enter image description here

Dwarfish answered 20/7, 2020 at 14:58 Comment(0)
P
3

In my case, launching git-bash.exe and pinning the result produced a shortcut to cmd.exe with no arguments, which just opened a regular command window. Creating a shortcut to git-bash.exe directly (either manually, or by pinning the existing Start Menu shortcut) caused the opened window to be separate from the pinned item.

What worked in my case (more manual):

  1. Create a shortcut to this command: %windir%\system32\cmd.exe /c "C:\Program Files\Git\bin\bash.exe" --login
  2. (Optional) "Change Icon...", then select the git-bash.exe location (one directory up from bash.exe), and click the icon selection area for the icon to show up and to select it.
  3. Update the "Start in" value to %HOMEDRIVE%%HOMEPATH%
Peril answered 13/8, 2021 at 12:49 Comment(1)
This is a great anwser, for me I wanted to execute a specific executable within the shell, turned out, having double quotes around the script was conflicting with cmd.exe. I used /k instead of /c which doesn't close the window on an error so I could debug this. Full command is something like this: %windir%\system32\cmd.exe /k "C:\Program Files\Git\bin\bash.exe" -c /c/tools/proxy/gontlm-proxy.exePolystyrene
I
2

Pinning the git-bash.exe fixed the problem for me. This also fixed the problem with broken icon graphic.

NOTE! This was on Windows 7 - haven't tested on Win10!

  1. Open Windows Explorer.
  2. Navigate to C:\Program Files\Git.
  3. Right click git-bash.exe, select Pin to Taskbar.
  4. Shift-right click the newly pinned icon, select Properties.
  5. Add to the end of the field Target: --cd-to-home
  6. Set the value of the field Start in: %HOMEDRIVE%%HOMEPATH%
  7. Press OK.

Git Bash Properties

Introduction answered 14/11, 2016 at 8:41 Comment(1)
More testing reveals problems: I did this on another Win7 computer with the same problem but pinning git-bash.exe did NOT fix the problem this time. I had to pin the opened Git Bash (the duplicated icon) and that one didn't duplicate.Introduction
U
2

None of the other solutions worked for me so here's what I did on Windows 10:

  1. Open Windows Explorer
  2. Navigate to C:\Program Files\Git
  3. Right click on git-bash.exe
  4. Right click on it and select Pin to Taskbar. This creates the first taskbar item.
  5. Run git bash by clicking on the taskbar item. This creates the second taskbar item.
  6. Pin the second taskbar item.
  7. Open the properties (right click on the icon -> right click on the app name -> properties) of the second taskbar item and fix them:
  8. Set Target to "C:\Program Files\Git\git-bash.exe" --cd-to-home
  9. Set Start in to %HOMEDRIVE%%HOMEPATH%
  10. Change the icon... Go to C:\Program Files\Git\ and select git-bash.exe and the icon.
  11. Close the properties window and unpin the first taskbar item.
Uncritical answered 16/1, 2021 at 0:28 Comment(0)
P
2

I have faced this problem. Here is a tried and tested solution. Very easy. Out of the 2 icons that you see, right-click on the inactive icon and do Unpin from taskbar. Then click on the active icon and do Pin to taskbar.

Photoengraving answered 29/4, 2021 at 16:49 Comment(0)
G
0

It's easy for Windows 10.

  1. Open Windows Explorer
  2. Navigate to C:\Program Files\Git
  3. Select git bash
  4. Select the 'Manage' option which appears under the field in purple 'Application Tools'
  5. Select the 'Pin to Taskbar' option which shows on the far left
Gower answered 18/3, 2018 at 5:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.