We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ git checkout -b {ブランチ名}
$ git commit --allow-empty -m {コミットメッセージ}
というわけで、よーし作業するぞとなったら上の2コマンドを打って pull request を作ってから作業開始してたんだけど、ブランチを切ったら空のコミットも同時にできちゃっていいんじゃないかな?と思えてきた。
というわけで調べて、.bashrc に以下のような function を書いた。
.bashrc
function branch() { git checkout -b $1; git commit --allow-empty -m "ブランチを作った: $1"; }
これで、$ branch hogemoge って打つだけでブランチを切ってブランチに移動して空のコミットをできるようになった。git push まで含めることもできるのかな? ちなみに alias には引数を指定できないらしい。
$ branch hogemoge
The text was updated successfully, but these errors were encountered:
write [alias] section in ~/.giconfig
[alias]
~/.giconfig
branch-empty-commit = "!sh -c 'git checkout -b $1 && git commit --allow-empty -m \"empty commit\"' -"
use:
git branch-empty-commit branch-name
Sorry, something went wrong.
@2get ありがとうございました! https://github.com/shikakun/dotfiles/commit/79a4f07abd775799047bd8b1dd7f7156b570b194
No branches or pull requests
$ git checkout -b {ブランチ名}
$ git commit --allow-empty -m {コミットメッセージ}
というわけで、よーし作業するぞとなったら上の2コマンドを打って pull request を作ってから作業開始してたんだけど、ブランチを切ったら空のコミットも同時にできちゃっていいんじゃないかな?と思えてきた。
というわけで調べて、
.bashrc
に以下のような function を書いた。これで、
$ branch hogemoge
って打つだけでブランチを切ってブランチに移動して空のコミットをできるようになった。git push まで含めることもできるのかな?ちなみに alias には引数を指定できないらしい。
The text was updated successfully, but these errors were encountered: