logicspike/docs

Learning

πŸ¦… LogicSpike Git Cheatsheet

A quick reference for our Feature Branch Workflow & Conventional Commits.


πŸš€ 1. Starting Work (New Feature)

Start a new feature from dev (Staging):

# 1. Switch to dev and get latest
git checkout dev
git pull origin dev
 
# 2. Create your branch
git checkout -b feat/my-new-feature

πŸ’Ύ 2. Saving Work (Committing)

Stage and Commit:

# 1. Stage all changes
git add .
 
# 2. Commit (Follow Conventional Commits!)
git commit -m "feat(auth): add google login provider"

Common Commit Types:

  • feat: ... (New feature)
  • fix: ... (Bug fix)
  • refactor: ... (Code cleanup)
  • chore: ... (Config/Deps)
  • docs: ... (Documentation)

πŸ”„ 3. Syncing & Sharing

Push your branch for the first time:

git push -u origin feat/my-new-feature

Update your branch with latest changes from dev:

git fetch origin
git merge origin/dev
# If conflicts: Fix files, then `git add .` and `git commit`

πŸ› οΈ 4. Advanced / "Oh $#!%" Commands

Undo last commit (Keep changes in staged area):

git reset --soft HEAD~1

Unstage a file (Remove from git add):

git restore --staged filename.ts

Discard all local changes (DANGER ⚠️):

git restore .

Change last commit message:

git commit --amend -m "feat: corrected message"

🧹 5. Cleanup

Delete branch locally (after merge):

git branch -d feat/my-new-feature

Delete branch remotely:

git push origin --delete feat/my-new-feature
Learning