问题
Is there a way to write an alias that adds current date to name of new branch?
For example:
git branch-today new_branch_name
should create new branch with 22_09_2015_new_branch_name
name.
回答1:
Create a git alias and add it to your .gitconfig
[alias]
branch-today = "!bt() { git branch $(date +%d-%m-%Y)_$1;}; bt"
git branch-today foo
Git branch output:
22-09-2015_foo
* master
来源:https://stackoverflow.com/questions/32719966/git-alias-to-add-prefix-to-name-of-new-branch