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

image.png

はじめに

前回に続き、Git 運用についてまとめです。
今回はざっくりと開発時の Git ワークフローをまとめます。

事前準備

リポジトリのクローン

git clone https://github.com/example/example-project.git
cd example-project

課題の作成

課題(Issue)の作成

  • GitHub 上で新しい Issue を作成
    • Issue は出来る限り具体的に細かく作成。単位が曖昧で大きい場合は、子 Issue を作成する
  • 課題番号を確認(例:#6)

ブランチ作成と開発

ブランチの作成

# レポジトリを最新化
git fetch

# 新しい機能ブランチを作成
# ベースはマージ先ブランチ origin/develop
git checkout -b feature/#6-add-new-feature origin/develop

「ブランチの命名規則と管理」については、今後記載予定

コードの実装とコミット

# コードを修正
# 変更したファイルをステージング
git add .

# 意味のあるコミットメッセージ
git commit -m "feat: #6 Add new feature implementation"

リモートブランチへのプッシュ

# 初回のプッシュ
# 初回でリモートの追跡ブランチを設定したので、次回以降は git push だけでよい
git push -u origin feature/#6-add-new-feature

コードレビュー

Pull Request(PR)の作成

  • GitHub web 画面で feature/#6-add-new-feature から develop への PR を作成
  • PR を Issue と関連付けさせる。Issue の右サイドの Development から PR を選択する。これで PR をマージすると、Issue が自動的にクローズされる

レビューフロー

「PRレビュー」については、今後記載予定

おわりに

GitHub の IssuePR のワークフローは開発には必須。すごく簡単な事だけど、意外と運用してなプロジェクトもある。
「一人プロジェクトだから必要ない」と言っている方、いつか引き継ぐ時に GitHub の内容は素晴らしい引継ぎ財産になりますよー

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?