0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

GitHub コマンド Tips

Posted at

GitHubのコマンドでつかうTips

リモートリポジトリに何が設定されているか確認

git remote -v
プッシュの時など Originalを指定する時に確認する際に使う

変更をadd

git add . 

ログを表示

git log 

コミットのログを表示してくれます。

helpを表示

git --help

コマンドの一覧を表示してくれます。[Hubインストール済みの場合はHubのヘルプも表示されます]

git help pull

helpの後にコマンド名を指定するとコマンドのヘルプ画面が表示されます。

コミットをする前に必ず実行(modified:というエラー発生時は必須)拡張子指定可  git add *.css

GitHubの基本コマンドでつよくつかうコマンド

プルPULL(取得)

git pull origin develop

コミット

git commit -m 'commmandtest'

プッシュ

git push origin develop:develop_0806 

第1引数 origin
git cloneした時に「origin」という名前でリモートリポジトリが設定されているのでそのまま指定

第2引数 develop
ローカルのリポジトリ名

第3引数 develop_0806
リモート先にプッシュするブランチ名

λ git push origin develop:develop_0808
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 313 bytes | 104.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/●●●●/training
 * [new branch]      develop -> develop_0808

こんな感じで実行されます。

プルリク【hubが必須】

git pull-request -b develop -h develop_0808 -m 'マージプリーズ【自動プルリク】' -r yamadatarou

例 -b はbaseマージ先ブランチ名
  -h はマージしたいブランチ名(主に修正したもの)
  -m コミットメッセージ
  -r レビューワ名

レビューワーはプルリクユーザー本人は基本設定できません。

バッチ内でGit pull-requestを使った時のエラー

git pull-request -b develop -h develop_0808_1252 -m testコメント
git: 'pull-request' is not a git command. See 'git --help'.

git pull-requestはコマンドでたたく時はうまくいったのですが
バッチ内に含めるとうまく実行されませんでした
ので hub pull-request で実行!解決!


HubインストールにはGOのインストールが必須
Goのインストール

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?