fix = "!f() { msg=$1; branch=${msg// /_}; git checkout -b ${branch}; git add --all; git commit -m "${msg}""; git push --set-upstream origin ${branch}; git checkout master; }; f""
Uso:
git fix ""this is a little fix""
Explicação:
f() {
msg=$1; # get first argument
branch=${msg// /_}; # normalize msg to use it as branch name
git checkout -b ${branch}; # checkout branch
git add --all; # add all file in staging area
git commit -m ""${msg}""; # commit with message
git push --set-upstream origin ${branch}; # push to origin
git checkout master; # go back to master
};
Tada!
“