Git Collaboration Guide
This guide provides simple instructions for collaborating on this website using Git branches.
Initial Setup (Do Once)
- Get repository access from repository owner
- Clone the repository: git clone https://github.com/yourusername/tati.studio.git
- 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)
- Go to GitHub.com repository
- Click “Pull Requests”
- Click “New Pull Request”
- Select:
- Base: main
- Compare: your-name-branch
- Click “Create Pull Request”
- Add title and description
- Click “Create Pull Request”
Handling Conflicts
If GitHub shows conflicts:
-
Get latest main: git checkout main git pull origin main
-
Update your branch: git checkout your-name-branch git merge main
- Fix conflicts:
- Open files with conflicts
- Look for «««<, =======, and »»»> markers
- Choose which changes to keep
- Remove conflict markers
- Save files
- Complete the merge: git add . git commit -m “Fixed merge conflicts” git push origin your-name-branch
Best Practices
- Work on different files when possible
- Pull from main frequently (daily)
- Make small, focused changes
- Communicate about which files you’re editing
- Write clear commit messages
- 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:
- Check your current branch: git branch
- Check file status: git status
- Look for error messages
- Ask your collaborator for help
- Check Git documentation: https://git-scm.com/doc
Remember: It’s okay to make mistakes! Git keeps history, so we can always fix things.