How can I create a git-bash shortcut which opens git-bash.exe and automatically runs "git status" and/or "git worktree list" at startup and then waits for my next command(s). I have tried:
".\git-bash.exe" -c "git status"
but the git-bash window closes immediately after executing git status
".\git-bash.exe" -c "git status;read"
, but this way it runs git status, waits for the enter key and closes the git-bash window
You can append the command 'exec $SHELL' to spawn a new interactive shell after your git commands exit. For example:
".\git-bash.exe" -c 'git status;exec $SHELL'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.