Überprüfen in C:\ofi
erst, ob die git nicht schon installiert ist.
C:\ofi
an.C:\ofi
. (Rechtsklick → Link speichern unter…)C:\ofi
.C:\ofi\PortableGit\
Die Datei .bashrc
wird im Laufwerk H:\ gespeichert und muss nur einmal angelegt werden.
cd
notepad .bashrc
alias notepad="'/c/Program Files/Notepad++/notepad++.exe'" alias python="winpty '/c/Programme/Anaconda/python.exe'"
alias
notepad
den etwas besseren Editor Notepad++.Laden Sie die Datei setup-aliases.bash herunter und führen Sie diese wie folgt aus (nachdem Sie ins Verzeichnis navigieren, wo Sie die Datei gespeichert haben:
cd /h/Downloads bash setup-aliases.bash
New-Item c:\ofi -ItemType Directory -ea 0 if (!(Test-Path C:\ofi\PortableGit\git-bash.exe)) { if (!(Test-Path c:\ofi\PortableGit.7z.exe)) { echo "Please wait while downloading..." Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/PortableGit-2.44.0-64-bit.7z.exe" -OutFile c:\ofi\PortableGit.7z.exe } else { echo "Portable git Installer is already downloaded" } echo "Please click OK to install Git-Bash" cd c:\ofi Invoke-Expression .\PortableGit.7z.exe } else { echo "Git Bash already installed!" } if (!(Test-Path "$env:USERPROFILE\.bashrc")) { echo "alias notepad='/c/Program Files/Notepad++/notepad++.exe'" | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII echo "alias python='winpty /c/Programme/Anaconda/python.exe'" | out-file "$env:USERPROFILE\.bashrc" -encoding ASCII -Append echo "Created .bashrc with aliases for notepad and python" } else { echo "~/.bashrc already exists, not touching it..." } Invoke-Expression C:\ofi\PortableGit\git-bash.exe