Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法编写一个别名,将当前日期添加到新分支的名称中?
例如:
git branch-today new_branch_name
应该使用名称创建新分支22_09_2015_new_branch_name。
22_09_2015_new_branch_name
创建一个 git 别名并将其添加到您的.gitconfig
.gitconfig
[alias] branch-today = "!bt() { git branch $(date +%d-%m-%Y)_$1;}; bt" git branch-today foo
Git分支输出:
22-09-2015_foo * master