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

【初心者用】Gitコマンド<clone~pushまで頻繁に使いそうなやつ>

1
Last updated at Posted at 2021-03-10

背景

僕含めGitコマンド不慣れな初心者が
clone~pushまで少しでも早く処理できるようにしたい。

コマンド一覧

cloneしたいディレクトリに移動
cd cloneしたいディレクトリ

リポジトリをclone
git clone URL(githubのリポジトリのURLを貼り付け)

ブランチをきる
git checkout -b feature/ブランチ名

ローカルブランチ確認
git branch

作業ブランチ変更したいなら
git checkout ブランチ名

---ここでローカルで作業をする---

ブランチの状態を確認
git status

作業した差分を確認
git diff

ステージング環境にあげる
git add 作業したファイル名

ステージング環境にあげた内容をコミット
git commit -m "コミットメッセージ"

コミットした内容をpush
git push -u `ブランチ名
※2回目以降のpushはgit pushでOK

push後に出てきたURLに飛んで処理する

終わりに

今回は初心者がよく使いそうなコマンドを書きました。
Railsチュートリアル終了後に
詳しい説明を加えた別記事を作成予定です。

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