flowchart LR
subgraph Local["Your Computer"]
A["Git Repository"]
end
subgraph Cloud["GitHub"]
B["Remote Repository"]
end
A -->|"push"| B
B -->|"pull"| A
B -->|"clone"| C["Collaborator's Computer"]
C -->|"push"| B
Part 7: Collaboration
Work with Git users and Word users
Learning Goals
By the end of this section, you will:
- Share your work on GitHub
- Collaborate with others who use Git
- Work with co-authors who prefer Word
- Use Track Changes effectively
Two Collaboration Scenarios
- Git Users — Use GitHub: clone, push, pull. Everyone sees the full history.
- Word Users — Render to
.docx, receive Track Changes, apply edits back to qmd.
Part 7a: GitHub Collaboration
Why GitHub?
- Store your repository online (backup!)
- Share with collaborators
- Everyone sees the history
- No more emailing files back and forth
Git = version control tool (local) | GitHub = website to share Git repositories (online)
In the Setup Guide, you created your repository from the template and pushed your work to GitHub. Now let’s collaborate!
Self-Study: GitHub Collaboration
This exercise is best done with a colleague or classmate after the workshop. It takes about 10-15 minutes and teaches real-world Git collaboration.
Find a partner and collaborate
Setup:
- Share your GitHub repository URL with a partner
- Go to your repository → Settings → Collaborators
- Click Add people and enter your partner’s username
- Your partner accepts the invitation
Clone and edit:
- Clone your partner’s repository (green Code button → copy URL)
- In Positron: File → Clone Repository → paste URL
- Open their
index.qmdand make a small edit - Save, stage, and commit with a message describing your edit
- Click Push
See the result:
- Check GitHub — you can see your partner’s commit
- In your own repo, click Pull to get their changes
Beyond Today: Branches & Pull Requests
In larger teams:
- Create a branch for your changes
- Open a Pull Request (PR) for review
- Team reviews and discusses
- Merge after approval
Today we used a simplified workflow (direct push to main). In practice, branches prevent conflicts and allow code review.
Part 7b: Working with Word Users
The Reality
- Not all collaborators use Git
- Co-authors often prefer Word
- Track Changes is the standard for feedback
- Unfortunately, there is no single principled way to work seamlessly between Word documents with tracked changes and qmd files (yet)
The Bare Minimum Workflow
qmd is always the “source”
Word documents are output, not source. Changes should flow back to qmd.
The Word Collaboration Workflow
flowchart TD
A["index.qmd"] -->|"render"| B[".docx"]
B -->|"send"| C["Co-author"]
C -->|"Track Changes"| D["feedback.docx"]
D -->|"review"| E["You"]
E -->|"edit"| A
A -->|"re-render"| F["Updated .docx"]
Never edit the Word file as source! Your edits will be lost on next render.
Best Practice: One Sentence Per Line
In your qmd file:
This is the first sentence.
This is the second sentence.
Each sentence on its own line.Benefits:
- Easier to match Word changes back to qmd
- Better Git diffs (see exactly which sentence changed)
Hands-on: Word Collaboration Cycle
Step 1: Render to Word
- Open
index.qmd - Render to
.docxformat - Find the Word file in your project folder
Step 3: Review and incorporate changes
- Open the Word file with Track Changes
- For each change:
- Manually apply the changes to the qmd file.
- You can use
pandocto convert the Word file back to markdown and apply the changes to the qmd file, but it could change formatting. - You can also use AI to reflect the suggested changes in the Word file to the qmd file, but always verify nothing is missed.
- Manually applying the changes is recommended for learning purposes.
- You can use
- Manually apply the changes to the qmd file.
- For each comment:
- Use GitHub issues
- Or use the GitHub pull request comments and review functionality
- This requires you create a separate git branch for the changes.
- Re-render and verify
Step 4: Commit your progress
Don’t forget to save your work with Git!
- Go to Source Control panel
- Stage
index.qmd - Write a descriptive commit message (e.g., “Incorporate co-author feedback from Word review”)
- Click Commit
- “Add co-author edits from Track Changes review”
- “Incorporate advisor feedback on introduction”
- “Apply reviewer comments on methods section”
AI for Track Changes
Speed up your review:
- AI can summarize many changes quickly
- “What are the main suggestions in this document?”
- Helpful for long documents with many comments
Caution: Always verify nothing is missed.
Summary
| Collaborator type | Workflow |
|---|---|
| Uses Git | Branch, edit, push, pull |
| Uses Word only | Render → Track Changes → apply to qmd |
Both workflows keep qmd as the single source of truth.