Git-Bash: Difference between revisions

From Omnia
Jump to navigation Jump to search
Line 9: Line 9:


Appearace - Text - Color Scheme - Foreground - Green #13A10E
Appearace - Text - Color Scheme - Foreground - Green #13A10E
</pre>
settings.json : C:\Users\USERNAME\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
%USERPROFILE%\AppData\Local\...\...
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
<pre>
    "profiles":
    {
        "defaults":
        {
            "historySize": 10000
        },
        "list":
        [
...
            {
                "commandline": "\"C:\\Program Files\\Git\\bin\\bash.exe\" --login -i",
                "foreground": "#13A10E",
                "guid": "{0ea4f5d7-2d8f-4570-b89b-eaf23fa8323f}",
                "hidden": false,
                "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "name": "Git Bash",
                "startingDirectory": "%HOMEDRIVE%%HOMEPATH%",
                "tabTitle": "Git Bash"
            },
</pre>
</pre>



Revision as of 01:30, 16 January 2026

Windows Terminal Profile

Name:  Git Bash
Command Line:  "C:\Program Files\Git\bin\bash.exe" --login -i
Starting Directory:  %HOMEDRIVE%%HOMEPATH%
Icon (file):  C:\Program Files\Git\mingw64\share\git\git-for-windows.ico
Tab Tile:  Git Bash

Appearace - Text - Color Scheme - Foreground - Green #13A10E

settings.json : C:\Users\USERNAME\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json

%USERPROFILE%\AppData\Local\...\...
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
    "profiles": 
    {
        "defaults": 
        {
            "historySize": 10000
        },
        "list": 
        [
...
            {
                "commandline": "\"C:\\Program Files\\Git\\bin\\bash.exe\" --login -i",
                "foreground": "#13A10E",
                "guid": "{0ea4f5d7-2d8f-4570-b89b-eaf23fa8323f}",
                "hidden": false,
                "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "name": "Git Bash",
                "startingDirectory": "%HOMEDRIVE%%HOMEPATH%",
                "tabTitle": "Git Bash"
            },

Bashrc

Prompt that will update the window title with the path:

$ cat .bashrc
# PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
PS1='\[\033]0;GB:$PWD\007\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]$ '
# PS1='\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
# PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '

Default PS1 is:

PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h \[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '

Symbolic Links

Requires Elevated Privileges: (or UAC turned off) [1]

export MSYS=winsymlinks:nativestrict
ln -s <target_path> <link_name>

Requires Elevated Privileges:

 cmd /c "mklink /D <link_name> <target_directory>" # For directory symlinks
 cmd /c "mklink <link_name> <target_file>" # For file symlinks

Turn on in Git:

git config --global core.symlinks true
# local only
git config core.symlinks true

---

CqSI8kO.png

ref: https://github.com/orgs/community/discussions/23591