Git Quick Command Cheat Sheet

🔑 Setup

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

📥 Clone Repository

git clone <repo-url>
cd <repo>

🔄 Update Code

git pull origin main

🌱 Create Branch

git checkout -b feature/branch-name

✍️ Stage & Commit

git add .
git commit -m "Descriptive commit message"

⬆️ Push Branch

git push origin feature/branch-name

🔀 Merge Workflow (via GitHub)

  1. Open Pull Request (PR).

  2. Review & approve.

  3. Merge into main.

↩️ After Merge

git checkout main
git pull origin main

⚡ Common Commands

git status # Check changes
git log # Show commit history
git branch # List branches
git checkout main # Switch branch
git diff # Show file changes

War dieser Artikel hilfreich?