Git Collaboration Guide

This guide provides simple instructions for collaborating on this website using Git branches.

Initial Setup (Do Once)

  1. Get repository access from repository owner
  2. Clone the repository: git clone https://github.com/yourusername/tati.studio.git
  3. Create your personal branch: git checkout main git checkout -b your-name-branch # Example: git checkout -b tati-branch

Daily Workflow

Before Starting Work

Get latest changes

git checkout main git pull origin main

Update your branch

git checkout your-name-branch git merge main

While Working

Save your changes

git add . git commit -m “Description of what you changed”

Push your branch to GitHub

git push origin your-name-branch

Sharing Your Changes (Creating a Pull Request)

  1. Go to GitHub.com repository
  2. Click “Pull Requests”
  3. Click “New Pull Request”
  4. Select:
    • Base: main
    • Compare: your-name-branch
  5. Click “Create Pull Request”
  6. Add title and description
  7. Click “Create Pull Request”

Handling Conflicts

If GitHub shows conflicts:

  1. Get latest main: git checkout main git pull origin main

  2. Update your branch: git checkout your-name-branch git merge main

  3. Fix conflicts:
    • Open files with conflicts
    • Look for «««<, =======, and »»»> markers
    • Choose which changes to keep
    • Remove conflict markers
    • Save files
  4. Complete the merge: git add . git commit -m “Fixed merge conflicts” git push origin your-name-branch

Best Practices

  1. Work on different files when possible
  2. Pull from main frequently (daily)
  3. Make small, focused changes
  4. Communicate about which files you’re editing
  5. Write clear commit messages
  6. Test changes before creating pull requests

Common Git Commands

Check which branch you’re on

git branch

Switch to a branch

git checkout branch-name

See your changes

git status

See your change history

git log –oneline

Undo uncommitted changes to a file

git checkout – filename

Undo your last commit (but keep the changes)

git reset –soft HEAD^

Getting Help

If you get stuck:

  1. Check your current branch: git branch
  2. Check file status: git status
  3. Look for error messages
  4. Ask your collaborator for help
  5. Check Git documentation: https://git-scm.com/doc

Remember: It’s okay to make mistakes! Git keeps history, so we can always fix things.