LoginSignup
2
1

More than 5 years have passed since last update.

GitHubのPull RequestをチェックアウトするGitのalias

Posted at

普通にかくとサブコマンドとして解釈されてしまうが!を使うとふつうの外部コマンドが書けてべんり1

However, maybe you want to run an external command, rather than a Git subcommand. In that case, you start the command with a ! character.
https://git-scm.com/book/tr/v2/Git-Basics-Git-Aliases

~/.gitconfig
[alias]
  gh = ! sh -c 'git fetch origin pull/$1/head:GH-$1 && git checkout GH-$1' --

  1. この例で!抜かすとgit-shコマンドが実行されてしまう 

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1