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
[Haima的博客]
http://www.cnblogs.com/haima/
分类:
Shell编程
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具