0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Gitの使い方 サマリ

Last updated at Posted at 2025-03-13

Github SSH接続方法

1.pubの内容、=公開鍵情報をコピペする

pbcopy < ~/.ssh/id_rsa.pub

2. SSH接続確認

ssh -T git@github.com

応答として下記が返って来ればOK

Hi (account名)! You’ve successfully authenticated, but GitHub does not provide shell access.

3. Clone

あとはGithub上の「Clone with SSH」を使ってクローンするだけ。

git clone git@github.com:user/repository.git

GitHub リモートリポジトリからブランチ作成、コミット、プッシュ、マージまでの流れ

1. リモートリポジトリのクローン

GitHubからリポジトリをローカルにクローンします。

git clone https://github.com/username/repository.git
cd repository

2. 新しいブランチの作成

新しい作業ブランチを作成し、そのブランチに切り替える

git checkout -b new-branch

3. ファイルを編集し、コミットを作成

編集後、ファイルをステージングし、コミットします。

コピーする
編集する
git add .
git commit -m "Add a new feature"

4. リモートリポジトリにプッシュ

新しいブランチをリモートリポジトリにプッシュします。

git push origin new-branch

5. プルリクエスト(Pull Request)の作成

GitHub上で、new-branch を main にマージするためのプルリクエストを作成します。

  • GitHubリポジトリのページにアクセスし、ブランチを選択後、「New Pull Request」ボタンをクリック。

6. マージ

プルリクエストが承認されたら、GitHub上で「Merge Pull Request」をクリックして main ブランチにマージします。

7. ローカルブランチの削除(オプション)

作業が完了したら、ローカルの作業ブランチを削除できます。

コピーする
編集する
git branch -d new-branch

これで、リモートリポジトリからローカル作業を行い、プルリクエストを通じてリモートに反映させ、マージまでの一連の作業が完了です。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?