LoginSignup
0
1

GitとGitHubを基本からまとめてみた【GitHubでチーム開発する方法】

Last updated at Posted at 2023-02-18

チーム開発の流れ

image.png

ブランチ:分岐して開発

①ブランチを作成する

$ git branch <ブランチ名>

②ブランチ一覧を表示する

$ git branch

//Githubのリモートブランチの一覧を表示したい場合
$ git branch -a

③ブランチを切り替える

$ git switch <ブランチ名>

//ブランチを新規作成して切り替える
$ git switch -c  <ブランチ名>

④ブランチの変更をマージする

$ git merge <ブランチ名>

//ブランチを新規作成して切り替える
$ git merge origin/main
        <リモート名><ブランチ名>

Githubトークンの取得方法

アクセストークンとは、コマンド ラインまたは API を使用して GitHub への認証を行うときに、パスワードの代わりに personal access token を使用することができる。

① ページの右上でプロフィールをクリックし、[Setting] をクリックする

② 左側のサイドバーで、[Setting] をクリックする

③ 左側のサイドバーの「Developer Setting」、「Personal accces token」、「Token(classic)」をクリックする

④ 「新しいトークンの生成」をクリックし、[有効期限] で、トークンの有効期限を選択する

⑤ sourceTreeなど、github clone を使用する際、下記の形で使用する。
image.png

https://[新しいトークン]@github.com/sample/sample.git

参考サイト

【Git入門講座 合併版】この動画1本でGitとGitHubの基礎をゼロからマスター!【初心者向け】
gitコマンドの使い方 ~ git merge ~
Github Docs

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