[英]All bash commands lost after sourcing bash_profile after osx upgrade
[英]customizing git commands in bash_profile to auto index to next branch
以下是我的自定义gitp命令,该命令非常有效(使用伪代码)。 我想通过自动索引并检出到新分支来添加到脚本中。 希望有一个命令行bash专家可以弄清楚! :)
previous_branch_num = 0;
gitp() {
git add -A &&
git commit -m "${1?'Missing commit message'}" &&
git push
git checkout -b "v{++previous_branch_num}" //<--psuedo code
}
只是:
#!/bin/bash
previous_branch_num=0
gitp() {
git add -A &&
git commit -m "${1?'Missing commit message'}" &&
git push
git checkout -b "v$((++previous_branch_num))" # <-- real code
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.