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

シンプルにGithubへpushする最短経路

Posted at

Githubにとりあえずpushしてコード管理したい

対象者

  • とにかくgithubを使ってみたい
  • 最低限のgitコマンドを知りたい

前提

  • Githubアカウントを作成済み
  • Githubでリモートリポジトリを作成済み

:notepad_spiral: 最短経路図

シーケンス図の説明

  • リモートリポジトリからクローン:
    • ユーザーがリモートリポジトリからローカルリポジトリに対して git clone コマンドを実行し、リポジトリのデータがローカルに複製されます
git clone
git clone <リポジトリURL>
  • ファイルの編集とステージング:
    • ユーザーがファイルを編集し、git add コマンドでこれらの変更をステージングエリアに追加します
git add
git add .

「.」(ドット)を忘れずに。変更をすべてステージングできます。

  • コミットとプッシュ:
    • ステージングされた変更を git commit コマンドでコミットし、その後 git push コマンドを使用してリモートリポジトリにプッシュします
git commit
git commit -m <コメント>
git push
git push -u <remote repository名> <branch名>

ローカルの master ブランチの変更をリモートリポジトリ (origin) の master ブランチにプッシュします。

-u オプションは、以後 git pushgit pull コマンドを使用する際にリモート名とブランチ名を省略可能にするため、アップストリーム (追跡) リンクを設定します。

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?