Help us understand the problem. What is going on with this article?

[wip] Git・Githubをより強力にするためのCLIツール

More than 5 years have passed since last update.

Git・Gihubをより強力にするためのCLIツールについて説明します。

目次

  • gh
  • hub
  • github-todos
  • git-extras
  • gitsh
  • git-open

gh

Github - gh

hub

Github - hub

hubのドキュメントにも書いてあるのですがhubをgitのコマンドのエイリアスにすると既存のgitのコマンドを強力にできて便利です。

# alias作成
$ alias git=hub

# 確認 
$ git --version
git version 2.2.0
hub version 1.12.2

Github URL: https://github.com/github/hub

github-todos

簡単にコードに書かれたTODOをGithubのissueに登録できる

Github URL: https://github.com/naholyr/github-todos

インストール

$ npm install -g github-todos

認証

$ [sudo] github-todos config github.token <your token>
$ github-todos auth                                                                                                 
No token found to access Github API. I will now ask for your username and password to generate one.
Those information ARE NOT STORED, only the generated token will be stored in your global git configuration.
If you don't want to let this process go you'll have to generate a token yourself and then save it with 'github-todos config github.token <your token>'.
? Github username: <your username>
? Github password: <your password>
Connection to Github API succeeded

init

$ github-todos init
[Github-Todos] To disable checking credentials on 'init', add option '--no-connect'
[Github-Todos] Hook file not found, create new one…
[Github-Todos] Hook installed
[Github-Todos] Option 'repo' is not set
[Github-Todos] Now guessing initial configuration from remote 'origin'…
[Github-Todos] Will use repository '<your repository>'
[Github-Todos] Run 'github-todos config' to check configuration, you may want to customize 'repo' option
[Github-Todos] OK

確認

$ github-todos config
github.token = <your github token>
repo = <your repository>

はまったところ

問題

pushできない:

$git push
TypeError: Cannot read property 'content' of undefined
error: failed to push some refs to 'git@github.com:<your username>/<your repository>.git'

解決策

最初からやりなし

git-extras

gitのデフォルトにはないがよく使うコマンドを追加してくれるもの

Github URL: https://github.com/tj/git-extras

gitsh

Github - gitsh

毎日のように、$ git ~と入力するのはも面倒なのでそれを解決するのが、gitshです。また既存のaliasなどもこのなかで使用することが可能です。

使い方

$ mkdir test && cd $_
$ touch README.md
$ gitsh
gitsh 0.8
Type :exit to exit
test uninitialized!! ⏎
fatal: Not a git repository (or any of the parent directories): .git

# git init
test uninitialized!! init
Initialized empty Git repository in /Users/sota/Desktop/test/.git/

test master! ⏎
On branch master

Initial commit

Untracked files:
    README.md

nothing added to commit but untracked files present

# git add .
test master! add .

# git commit -m 'Create README'
test master& c 'Create README'
[master (root-commit) 381e857] Create README
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README.md
test master@ ^D

インストール

$ brew tap thoughtbot/formulae
$ brew install gitsh

git-open

Github - git-open

244a0b72-a3d0-11e4-8ab9-55fc64228aaa.gif

unbabel
autify
アジャイルチームのためのQA自動化ソリューションの Autify を開発するスタートアップ
https://autify.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした