01.windows 环境设置

windows下可以安装Git工具,

使用git bash操作

Windows 10 环境下,通过~/.bash_profile 设置 git bash 别名:

打开 git bash,需切换到当前用户主目录(若存在.bash_profile 文件,则不需要执行 touch 命令):

$ cd ~
$ touch .bash_profile 
$ vim .bash_profile 

打开后,在~/.bash_profile 文件中,输入如下格式代码设置 git 命令别名:

alias gs='git status'
alias ad='git add'
alias cm='git commit -m'
alias pl='git pull'
alias ps='git push'
alias br='git branch'
alias ck='git checkout'
alias mg='git merge'
alias df='git diff'
alias log='git log'
alias ll='ls -l'

别名设置好保存后,回到 git bash 需要执行以下代码,使其生效:

$ source ~/.bash_profile 

windows上git bash中chmod +x不起作用

在 windows 上的 git bash 中执行下面的 chmod 命令

$ chmod +x test.sh

执行后对应的文件依然是不可执行的

-rw-r--r-- 1 admin 197121   0 5月  16 11:57 test.sh在 windows 上的 git 

bash 中执行下面的 chmod 命令

$ chmod +x test.sh

执行后对应的文件依然是不可执行的

-rw-r--r-- 1 admin 197121   0 5月  16 11:57 test.sh

问题原因

shell脚本前面没有加上#!/bin/bash

posted @   HaimaBlog  阅读(275)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
点击右上角即可分享
微信分享提示