Closed8

gh CLIの学習めも

yuuki.hyuuki.h

gh repo clone OWNER/REPOでリポジトリをクローンできる(git clone URL相当)

yuuki.hyuuki.h
  • 私がgitでよく使うコマンドの対応表を作る
  • 便利なエイリアス、スクリプト作る
yuuki.hyuuki.h

よく使うエイリアス

63 alias status="git status"
 64 alias add="git add"
 65 alias commit="git commit"
 66 alias push="git push"
 67 alias pull="git pull"
 68 alias fetch="git fetch"
 69 alias merge="git merge"
 70 alias branch="git branch"
 71 alias clone="git clone"
 72 alias diff="git diff"
 73 alias pushoh="git push origin HEAD"
 74 alias switch="git switch"
 75 alias stash="git stash"
yuuki.hyuuki.h

git checkout or git switch的なコマンド

gh pr checkout {<number> | <url> | <branch>} [flags]

git switch -c <branch>相当

# pr作成
gh pr create new-branch

# prのブランチに入る
gh pr checkout new-branch
yuuki.hyuuki.h

よく見ていると、完全にgitを置き換えるわけではなく
githubの操作を単純にするだけっぽい。

対応表作ってみるか

yuuki.hyuuki.h

そもそも全て対応している訳でもないのと
技術的に若干異なる気もするので表は作らない

このスクラップは2ヶ月前にクローズされました