- Install and configure Ubuntu WSL
- Install application
- Docker in Windows without Docker Desktop
- Docker/Kubernetes Clients
- Git tricks
- GIT for Windows
- Ubuntu WSL:
sudo apt install -u git
git config --global init.defaultBranch main
git config --global user.name "Gorshkov"
git config --global user.email [email protected]
git config --global core.autocrlf false
git config --global core.eol lf
git config --global alias.last 'log -1 HEAD'
#git config --global pull.rebase true
git config --global core.longpaths true
git config --global core.editor "'/mnt/c/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
- Create script
mkdir -p ~/.git-scripts && touch ~/.git-scripts/set-email.sh && chmod +x ~/.git-scripts/set-email.sh
#!/bin/bash remote=`git remote -v | awk '/\(push\)$/ {print $2}'` [email protected] if [[ $remote == *mycompany.com* ]]; then [email protected] fi echo "Configuring user.email as $email" git config user.email $email
- Create alias
git config --global alias.set-email \!"bash -c ~/.git-scripts/set-email.sh"
- Setup hooks folder
mkdir -p ~/.git-scripts/hooks && git config --global core.hooksPath ~/.git-scripts/hooks
- Create
post-checkout
hooktouch ~/.git-scripts/hooks/post-checkout && chmod +x ~/.git-scripts/hooks/post-checkout
- Set content of created file
#!/bin/bash # On clone “previous SHA” is all zeros if [[ $1 == 00000000000* ]]; then git set-email fi
See links:
- Setup hooks folder
mkdir -p ~/.git-scripts/hooks && git config --global core.hooksPath ~/.git-scripts/hooks
- Create
commit-msg
hooktouch ~/.git-scripts/hooks/commit-msg && chmod +x ~/.git-scripts/hooks/commit-msg
- Set content of created file
#!/bin/bash remote=`git remote -v | awk '/\(push\)$/ {print $2}'` echo $remote if [[ $remote == *mycompany.com:SOME.REPO.GROUP* ]]; then test "" != "$(grep 'SOMECODE-' "$1")" || { echo >&2 Issue code SOMECODE-xxxx is required. exit 1 } fi
See links:
Read downstream article
- TortoiseGit
- Use Open SSH agent
- Use Credential Manager
manager-core
Read downstream article
Read downstream article