1
1

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 1 year has passed since last update.

Git 個人的よく使うもの纏め

Last updated at Posted at 2019-06-19

git clone~pushするまでの一覧の流れ

# clone
git clone [repo]
# ブランチを切る
git checkout -b [branch_name]
※リモートリポジトリを行う場合下記で実施
git checkout -b [local branch_name] origin/[remote branch_name]
# ローカル変更、テスト実施

# ファイルを追加
git add [filename]

# ファイルをコミット
git commit -m "commit message"

# ファイルをリモートリポジトリにpush
git push --dry-run origin [branch_name]
git push origin [branch_name]

gitのaddを取り消す

git reset HEAD (filename)

ローカルで削除したものをgitに反映

# 方法1
git add -u #u is Update
# 方法2
git rm filename

直前のコミットログ修正

git commit --amend

push

//dry-runは必ず行う
git push --dry-run origin branch:branch
git push -origin branch:branch

log

//1行のみ
git log --oneline
//graph表示
git log --graph --oneline 

参考資料

https://qiita.com/nabezokodaikon/items/7ee4900d28d8d863978e
https://qiita.com/cyokodog@github/items/c66417aacb903afb472a

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?