-
Notifications
You must be signed in to change notification settings - Fork 158
Git and GitHub Workflow
The workflow illustrated here is the way we should handle content and source in the winforms-docs repository.
There will be two branches present at all times - master and prodiction. The master branch will contain all content. The production branch will contain the content that is live. Any new content should be added to master first. If the new information should go live it should be cherry-picked to production.
-
Decide that something needs an update. Or new information should be added. (Every journey begins as an idea :) )
-
Add the new information to master. The change can be minor or major. If the content you have added should go live with the next major release - you are done, else read on.
-
If you are reading this, then the change should go live as soon as possible. The commits that should go live have to be cherry-picked and added to production branch.
Minor changes like fixing typos, grammatical corrections can be pushed in the master branch directly, without creating a new branch.
-
Make sure you are working with the latest changes pulled from GitHub (Pull with Re-base);
-
Implement the required changes;
-
Stage the affected files (Stage Files);
-
Commit the changes locally (Committing);
-
Again, pull any changes from GitHub to make sure that the push will be successful (Pull with Re-base);
-
Push your commit to the master branch on GitHub (Pushing Commits)
-
If the changes should go live immediately - cherry-pick them and add them to production. (Cherry-picking);
Major changes are more complex fixes, restructuring articles, adding new articles, etc. Working on such tasks should be done in a branch, that later to be used for a Pull Request.
-
Make sure you are working with the latest changes pulled from the master branch on GitHub (Pull with Re-base);
-
Create and Checkout branch with a meaningful name (Create new Branch and Checkout Branch);
Tip: You can use one command for both actions
git checkout -b MyBranch
-
Publish the branch to GitHub (Push Branch to GitHub);
-
Changes made on the branch can be done in several commits (as much as you need, in order to have proper history/backlog) (Push Commits to Branch).
If there are other collaborators working on this branch, you should periodically pull and push changes to the published branch in GitHub.
-
When the task is done, make sure the branch is synced with the master branch (Syncing Changes from the Remote's master Branch);
-
Push any additional changes derived from the master branch (Push Commits to Branch);
-
Initiate a Pull Request from GitHub (Pull Requests).
Important: GitHub will alert you if the Pull Request is clean. If this is not so, go back to your local repository and make sure any conflicts are locally resolved.
-
If you want your changes to go live cherry-pick them and add them to production. (Cherry-picking);
Generally, articles should be reviewed by another person before going live to improve their quality.
For new articles that have not existed yet, it is best to create a branch.
It is recommended that articles pass through peer review by your team before they are published and/or sent for copy-editing by a single person. If this is impossible, it is still good to have the peer review after the copy-editing phase, and if there are changes they should be copy-edited again.
Always keep the Style Guide in mind when writing/editing/reviewing.
Here follows a general description of the processes.
Once you are done writing, you should:
-
Get a Peer Review from your team, if possible, and apply the changes you agreed on.
-
Open a Pull Request and assign it to the person who will review it (e.g., copy editor).
- Make sure to include information in the Pull Request that clearly indicates what should be edited (e.g., branch name and folder if its entire contents are for review; or a link to a concrete article on GitHub)
-
When you are done with the discussion, rebase your change/feature branch from the source branch and merge it to the base branch.
-
In most cases you can then delete the change/feature branch afterwards.
For articles that exist live and need to be improved:
-
Open an Issue in GitHub
-
Link the article that is to be improved and specify the branch
-
Assign the Issue to the reviewer/copy-editor.
Working with a reviewer in GitHub:
-
Important: Make sure to look for reviewer/editor comments in the content, they will usually be something like
(COMMENT: comment goes here)
and make sure to delete them before the article goes live (after applying any necessary changes, of course). -
Even if there are only minor issues (typos, commas, etc.) the reviewer will create a branch and open a Pull Request for your review, so you can merge it and cherry-pick into production.
-
If there are many issues (e.g., with the Style Guide adherence, sentences/paragraphs not making sense, etc.), the reviewer/editor may not fix them, but leave a comment for the writer to fix them.
-
Generally, the reviewer will create a new branch stemming from the specified branch, apply changes/suggestions/comments there and open a Pull Request where the standard workflow applies.
-
Team members must monitor the Pull Requests section and quickly deal with new ones.
-
The Issue is to be closed after the Pull Request is merged.
-
- Home
- Getting Started
- Deploying Documentation on IIS
- Git and GitHub Workflow
- Handling Redirects
- Markdown Syntax
- Markdown Nesting
- Using Git and Git Bash
- Troubleshooting
- Use VS Diff tool with Git and SourceTree
- [How to deal with the web.config size limit in order to add URL redirects](./How to deal with the web.config size limit in order to add URL redirects)