问题描述
因为想快捷操作git;所以想用别名来解决结果无法实现:
![在.gitconfig中设置参数 [alias] pre = !cd 某个目录;然后能运行但是不会跳转到目录下,求解](http://www.6hehe.com/data/image/answer/202309/121324dad0.png)
然后再用 git pre 命令
![在.gitconfig中设置参数 [alias] pre = !cd 某个目录;然后能运行但是不会跳转到目录下,求解](http://www.6hehe.com/data/image/answer/202309/12132417e3.png)
并不会跳转到指定目录中
其他如 ls -a ;git pull等设置别名都没有问题唯独 cd 命令不行……
问题解答
回答1:git alias是自己的進程, 在子進程cd不會影響到父進程(你的shell)
你可以寫個shell函數或shell alias

问题描述
因为想快捷操作git;所以想用别名来解决结果无法实现:
![在.gitconfig中设置参数 [alias] pre = !cd 某个目录;然后能运行但是不会跳转到目录下,求解](http://www.6hehe.com/data/image/answer/202309/121324dad0.png)
然后再用 git pre 命令
![在.gitconfig中设置参数 [alias] pre = !cd 某个目录;然后能运行但是不会跳转到目录下,求解](http://www.6hehe.com/data/image/answer/202309/12132417e3.png)
并不会跳转到指定目录中
其他如 ls -a ;git pull等设置别名都没有问题唯独 cd 命令不行……
问题解答
回答1:git alias是自己的進程, 在子進程cd不會影響到父進程(你的shell)
你可以寫個shell函數或shell alias
相关文章:1. centos 6.4下tomcat6配置虚拟目录失败2. Apache服务器开启HTTPS访问3. bash - linux time 命令,为什么一定要指定绝对路径,4. centos - 在 nginx 服务中读取信息时出错:没有那个文件或目录5. apache 的 aliases,redirecting,rewriting 都有什么区别?6. linux - 客户-服务器程序错误Program received signal SIGPIPE, Broken pipe.7. centos - win下连接openvpn失败8. nginx - 关于服务器搭建问题9. centos - 请教一个关于 iptables 的问题10. apache - 关于独立服务器虚拟化,部署lamp架构的的设计提案?

网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网
声明:本站所有资源以学习为主