Yuntong Man
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: mstu5003 --- # Github Team Workflow ## Step One -- Initiate One person from your team should create a github repository. The process is exactly the same as how you normally create a repository. > this person will be the main controlling person. Let's call her/him ==Montana== from now on for easier reference > > make sure your repository is set to ==public==. If it's a private repository, your teammates can not view it. :::info As an example, we will use the following Github for demo purpose: https://github.com/ymm2110/10-minutes-timer ::: **Result after step 1:** ![img](https://raw.githubusercontent.com/ymm2110/teamflow/master/step1-newRepo.png) ## Step Two -- Fork Other members should login their own accounts, find ==Montana== 's repository, and use the `fork` botton on the upper right corner to fork the repository. [What is fork?](https://help.github.com/en/articles/fork-a-repo) **Result after step 2:** After forking someone else's github successfully, you should see that in your own github account, a new github is created referencing to the orignal github. For example, after user zhenzhenqi successfully fork user ymm2110 on a repo called 10-minutes-timer, user zhenzhenqi will see the following result: ![](https://i.imgur.com/VLTnVaL.png) ## Step Three -- Edit Clone or download the code to your local environment/ - if you wnat to use GitHub Desktop to clone: 1. click the "open in Desktop" button from the webpage then follow instructions ![img](https://raw.githubusercontent.com/ymm2110/teamflow/master/step2-cloneWithGithubDesktop.png) 2. when the Desktop App open, use the "choose" button to change where you want to store the files if necessary. Click `clone` to complete the clone process. ![img](https://raw.githubusercontent.com/ymm2110/teamflow/master/step2-cloneWithGithubDesktop2.png) - if you're using terminal to clone: To clone, use command `cd` to navigate to the folder location you want to use, then use command `git clone` followed by the github address For example: `git -clone https://github.com/zhenzhenqi/10-minutes-timer.git` Now, you have all the code ==Montana== (and other teammates') wrote in your local environment. **You can now start coding!** :smile: When you complete a good amount of work, ==commit and push== the changes to **your** own repository. ## Step Four -- Pull Request ### Downstream to Upstream Now, when you go you **your** own repository page on github, you should be able to see Github showing message like > This branch is 1 commit ahead of ==Montana==:master. Let's sync your progress back to ==Montana=='s repository - if you're using GitHub Desktop 1. Click the `new pull request` button to create a new pull request. [What is a pull request?](https://help.github.com/en/articles/about-pull-requests) 2. After clicking the button, you will see github showing you all of the changes you've made that are ahead of the master branch, aka Montana's branch. ![img](https://raw.githubusercontent.com/ymm2110/teamflow/master/ahead.png) 3. If there's no conflict, you'll see a green message says ==√Able to merge==. Click the `new pull request` and follow the steps to create the request. ![img](https://raw.githubusercontent.com/ymm2110/teamflow/master/changes.png) 4. Now, when ==Montana== logs into his or her account, Github will display a pull request that need response. ==Montana== needs to approve the request. - if you are using terminal, 1. cd into the cloned folder and type `git status` You will see the changes you made: ![](https://i.imgur.com/0eTKC2g.png) 2. type the following commands to push changes ``` git add --all git commit -m "some message" git push origin master ``` ## Step Five -- Merge ### Approve the merge Now, you created a ==request== to add your code to ==Montana=='s. But ==Montana== haven't approve this request yet. > why ==Montana== need to approve? > imaging you're a famous coder and create amazing resources for other programmers. Now, a ramdom person decides to contribute the project. He forked your repo, cloned, and created a pull request. If there isn't the approve process, his code will automatically be a part of yours. Maybe his codes make cool improvement, but what happenes if his code doesn't work, or conflict with your ideas? Without the approval process, your repo will soon become an open canvas that everyone can draw on it. Messy alert! Now, let's figure out how can ==Montana== do the approval. 1. ==Montana== needs to go to the repository from GitHub Webpage. Next to the 'Pull Request' tab, there should be a little number there(`1` in our example). ![step4-merge-1](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-1.png) 2. click on title of the pull request (`changed h1 color` in our example). Github will display details of this request, and run an automatic diagnose of if there's any problems, such as code conflicts. If there's no conflict, Github will say `This branch has no conflicts with the base branch. Merging can be performed automatically.` ![step4-merge-2](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-2.png) 3. click `merge pull request`, edit the commit message or description if necessary, then click `omfirm mergre` to comfirm. [what's a merge?](https://help.github.com/en/articles/merging-a-pull-request) ![step4-merge-3](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-3.png) 4. after comfirmation, Github will show ==Montana== that your merge is completed. ![step4-merge-4](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-4.png) 5. Now, the code online is updated and synced. But what about the version on your local environment? Go to Github Desktop, click 'fetch' button to read updates that you made online. ![step4-merge-5](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-5.png) 6. Github Desktop will show you how many changes are made (aka, how many commit is your local environment behind the online version). Click `pull origin` to download these changes to your local environment. ![step4-merge-6](https://raw.githubusercontent.com/ymm2110/teamflow/master/step4-merge-6.png) 7. Congrats! Now, ==Montana== has the most recent updated codes on both his/her local environment and online on Github. If ==Montana== opens the project in Atom now, he/she will be able to edit the most up-to-date codes. ### solve conflicts In the previous step, we assume that there's no conflicts. What happens if we do? :::info conflicts happens when two or more people work on the same code, or when you're working on an older version, but your teammates are working on a newer version, or vice versa. The best way to avoid this is 1. team members should work on differnet section of the project, so you do not conflict each other. For example, if you're team is creating a to-do list, one person can work on `to-do-item-list.tag` and another person can work on `user-login.tag` 2. Team communication is the key. ==Montana== should let others know new pull request is approved, and you should always `fetch` from ==Montana=='s code before you resume working. We'll cover fetch in the next section. ::: How can we know if there's a conflict? If a teammember and ==Montana== changed the same line of code, both pushed to their repository, and the teammember created a pull request. When ==Montana== tries to approve the merge, an error message will show. ![step5-conflict-1](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-1.png) Now, in the unfortunate case, if we do have conflict, we solve the probelm by 1. click the 'Resolve Conflicts' button to go to the editing page. This page will show ==Montana== exactly where are the conflicts. ![step5-conflict-2](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-2.png) 2. Edit the code to keep the lines that you want to keep. Remember to delete the `<<<`, `===`, and `>>>` generated by Github as well. ![step5-conflict-3](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-3.png) 3. Once done, click the 'mark as resolved' button to complete. Now, Github will give you an green checkmark to show that the problem is solved. ![step5-conflict-4](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-4.png) 4. Click `comfirm merge` to comfirm. Github will pop an alert box, click `i understand` ![step5-conflict-5](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-5.png) alert window ![step5-conflict-6](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-6.png) 5. Now, Github will show that the conflicts is gone and you can comfirm the merge as shown in the last step. ![step5-conflict-7](https://raw.githubusercontent.com/ymm2110/teamflow/master/step5-conflict-7.png) remember, ==Montana== still need to use Github Desktop to `fetch` and `pull` to make sure the local file is the same as the files online. ## Step Six -- Fetch and Pull ### Upstream to Downstream Now, your repository and ==Montana=='s repository are synchronized. But how about other members in the team? Or what happens when your teammates make updates but your repository is behind? Now, once you need to sync **from** Montana's repository. 1. In GitHub Desktop, click the `current branch` tab and choose `choose a branch to merge into master` ![step6-pull-1](https://raw.githubusercontent.com/ymm2110/teamflow/master/step6-pull-1.png) 2. Choose `upstream/master`. If ==Montana=='s repository is ahead of you, you will see a message that says `this will merge 1 commit fom upstream/master to master`. In this case, `upstream/master` means ==Montana=='s repository, and `master` means your repository. ![step6-pull-2](https://raw.githubusercontent.com/ymm2110/teamflow/master/step6-pull-2.png) 3. Now, your local repo is synchronized with Montana's. If you check the `history` tap of Github Desktop, you can see that your merging history is here as well. Remember to `Push Origin` so that your online repo is synchronized as well. ![step6-pull-3](https://raw.githubusercontent.com/ymm2110/teamflow/master/step6-pull-3.png) :::info To make sure everyone's repository are always up to date, **always** fetch from ==Montana=='s before you start to make new changes. Montana should check new pull request regularly and make sure to approve them in a timely manner. Team members should **NOT** work on the same tag or the same section at the same time. Otherwise your codes will conflict with each other. ::: ## Suggested Team Practice :::success The team should first discuss who is in charge of which part, and code individually. Every night, all team member should commit their code and create pull request. ==Montana== should reslove all conflicts if there's any, approve all requests. All team member should fetch and pull origin after the approval. :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully