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?

Gitの最低限コマンドメモ

Posted at

小規模アプリ開発用 Git 運用テンプレ

個人開発でも安心してGit管理するための最小限ステップメモ

1️⃣ プロジェクト作成 & Git初期化

bash
# フォルダ作成
mkdir myapp
cd myapp

# Git初期化
git init

2️⃣ .gitignore(必要最低限)

プロジェクトの言語に応じて不要ファイルを無視します。
例: Python

bash
__pycache__/
*.pyc
.env

3️⃣ 最初のコミット

bash
git add .
git commit -m "初期コミット"

4️⃣ GitHubにアップ(任意)

bash
# リモート追加
git remote add origin <リポジトリURL>

# mainブランチに切り替え(初期化後)
git branch -M main

# 初回push
git push -u origin main

5️⃣ 開発中の基本ルール

こまめにコミット → 機能追加や修正ごとに1回
ブランチ運用(任意)
main → 完成コード
feature/xxxx → 開発中コード
pushは節目で → クラウドにバックアップ

6️⃣ 日常でよく使うコマンド

bash
git status       # 変更確認
git add .        # 変更をステージ
git commit -m "" # コミット
git pull         # 最新コードを取得
git push         # クラウドにアップ
git log          # 履歴確認

7️⃣ Gitワークフロー図(小規模アプリ向け)

   開発開始
       │
       ▼
   git init → main
       │
       ▼
  featureブランチで開発
       │
       ▼
  こまめに commit
       │
       ▼
  完成したら main に merge
       │
       ▼
  push で GitHub にアップ
       │
       ▼
  バックアップ & チーム共有完了

💡 ポイント

最初からGitを使うと「途中でのやり直し」や「ミスの巻き戻し」がラク

小規模ならこのテンプレ+ワークフローだけで十分

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?