Skip to content

Instantly share code, notes, and snippets.

@katai5plate
Last active May 6, 2018 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katai5plate/61d1d03da425445335f49c7cd981e583 to your computer and use it in GitHub Desktop.
Save katai5plate/61d1d03da425445335f49c7cd981e583 to your computer and use it in GitHub Desktop.
Git操作方法メモとバッチツール

クローン

git clone

新規ブランチ作成

git checkout -b <new branch name>

ブランチ名の変更

git branch -m <old branch name> <new branch name>

更新したファイルを追加

git add *
git add <changed file name>
  • -u: 新規に追加されたファイルはAddしない
  • -A: 全ての変更をAddする

コミット

git commit -m "<description>"

プッシュ

git push origin <branch name>

Addする前の状態で編集内容を取り消す

git checkout .

GitHubのissueラベル

name discription
bug バグ
duplicate 重複
enhancement 機能強化
good first issue 初心者向け
help wanted 助けて
invalid 間違い・勘違い・実現不可能
question 疑問
wontfix 未対応
@echo off
call git diff --stat
set /p arg=Add:
call git add %arg%
@echo off
call git branch
set /p arg=Branch:
call git checkout -b %arg%
@echo off
call git branch
set /p arg=Branch:
call git checkout %arg%
@echo off
set /p arg=CommitMes:
call git commit -m "%arg%"
@echo off
call git branch
set /p arg=Branch:
call git push origin %arg%
@danmaq
Copy link

danmaq commented Apr 28, 2018

補足。

  • すでに push 済み(公開済み)のブランチを再 push する際は git push だけでおkだったりします。
  • 全ファイルを追加したい場合は git add -A も使えます。
  • ローカルブランチを消したい場合は git branch -d
    なお強制的に消したい場合は git branch -D(危険なので多用厳禁)

@katai5plate
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment