Useful GIT information on Windows

Some useful Git info

Winget Custom Install

installing Git with EnabledSymLinks and windows terminal intergratio

1winget install Git.Git --custom "/o:EnableSymlinks=Enabled /Components=ext,ext\shellhere,ext\guihere,gitlfs,assoc,assoc_sh,windowsterminal,scalar"

Symbolic Links and Git on Windows Create the Symbolic link using gitbash and NOT Windows PowerShell

 1#Set global variable to use symlinks
 2git config --global core.symlinks true
 3
 4#check the config is set
 5git config --show-scope --show-origin core.symlinks
 6
 7#clone remote repo
 8cd /
 9git clone https://github.com/xxxx/xxxx.git
10
11#create symbolic link
12cd xxxx
13ln -s '/c/Users/xxx/Documents/WindowsPowerShell/' WindowsPowerShell
14
15#New symbolic link isn't under version control
16git ls-files
17#Add symbolic link folder to version control
18git add WindowsPowerShell/
19#The new folder is under version control
20git ls-files
21#Local commit of the changes
22git commit -m "Finally adding the Windows PowerShell folder in correctly"
23#Push changes to remote
24git push

Git context menu items missing

Hammer Option

  1. Uninstall git
1winget uninstall git
  1. Open regedit as an admin
  2. Go to ‘HKEY_CURRENT_USER/Software/Classes/Directory/Background’
  3. Delete key ‘shell’
  4. Open regedit
  5. CTRL+F - Look at Keys only and uncheck Match Whole String Only - git_
  6. Delete key
  7. F3 to find next and delete key again and repeat
  8. Reinstall git
1winget install git
  1. Restart Explorer

Less Hammer

  1. Open regedit as an admin
  2. CTRL+F - Look at Keys only and uncheck Match Whole String Only - git_
  3. point items to correct place example below
 1[HKEY_CLASSES_ROOT\Directory\background\shell\git_gui]
 2@="Open Git &GUI here"
 3"Icon"="C:\\Program Files\\Git\\cmd\\git-gui.exe"
 4
 5[HKEY_CLASSES_ROOT\Directory\background\shell\git_gui\command]
 6@="\"C:\\Program Files\\Git\\cmd\\git-gui.exe\" \"--working-dir\" \"%v.\""
 7
 8[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell]
 9@="Open Git Ba&sh here"
10"Icon"="C:\\Program Files\\Git\\git-bash.exe"
11
12[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell\command]
13@="\"C:\\Program Files\\Git\\git-bash.exe\" \"--cd=%v.\""