Skip to content
OnMSFT.com
  • Home
  • About
  • Contact
  • Windows
  • Surface
  • Xbox
  • How-To
  • OnPodcast
  • Edge
  • Teams
  • Gaming
Menu
  • Home
  • About
  • Contact
  • Windows
  • Surface
  • Xbox
  • How-To
  • OnPodcast
  • Edge
  • Teams
  • Gaming
  1. Home
  2. Getting Started with GitHub – Collaboration

Getting Started with GitHub – Collaboration

admin admin
March 23, 2021
5 min read

In this article

  • Step 1 Initialize a new project
  • Step 2 Setup Your Team
  • Step 3 Collaborating
  • Step 4 Rinse, Repeat
  • Summary

First time using GitHub to collaborate with your team in software projects? This is one of many ways to collaborate on a project using GitHub. But it’s one I would suggest if you’re just starting out working with a team and haven’t established a git flow yet or know where to start in establishing one.

In this final article explores collaboration of software teams projects in GitHub, especially for working in teams, making it all the more efficient, productive and, most importantly, fun! Here’s how you collaborate on GitHub.

Step 1: Initialize a new project

Create a new project/directory from the command line:

‘$ rails new github_guide’

New Repo

Go to GitHub and click the ‘+’ button in the top right corner and select ‘New Repository’. Then fill out the Repository name and the Description fields. Keep it public, and do not “Initialize this repository with a README”. Don’t change anything else. Click “Create repository”.

Create Repo

Next you’ll see the setup page. These are instructions for connecting Repo you just created in GitHub (Remote) to the directory you created in your terminal (Local).

Command Line

Paste the lines in the red box line by line starting with “echo…” into the terminal while you’re cd’ed into the directory you just created locally. Your terminal should look like this when you’re done:

Terminal

This adds a ‘.git’ folder to your repo, connects you to your remote GitHub Repo and also gives you a ‘.gitignore’ file.

Remote Github

And of you go to your GitHub Repo page, you’ll see the ReadMe that you initialized with and the reference to the first commit you made.

Github Readme

Now let’s get this Repo up to date. Go back to your terminal and git add, git commit, and git push:

Second Commit

Now check out your repo. It should have all the files you created your local directory with along with a new commit id (9c2e2f6):

Local Directory

You’re initialized and ready to start working!

Step 2: Setup Your Team

You’re a team player, so you’re going to need to add your team to your repo so they can collaborate. Once your team is added as collaborators they’ll be able to push, merge, and a ton of other destructive things so make sure you’re only adding your teammates.

Click on the “Settings” tab of your rep, then “Collaborators” then search for GitHub users and add them by clicking “Add Collaborator”:

Github Collaborator

They’ll receive an email letting them know you added them and will be listed as a collaborator.

Github Collab Invite

Github Copy Link

Github Clone

And now you’re ready to collaborate!

Step 3: Collaborating

When you’re using git to work on the same project with multiple people, there’s one central rule you must follow:

The master branch should always be deployable. The way to keep Master deployable is to create new branches for new features and merge them into Master when they’re completed. Here’s how that works.

To start, branches should always represent features. For example, if you want to add the ability for a user to login you should probably create a branch called “user_authentication” and in that branch you should only update what you need to enable a user to login.

 

So let’s say you want to create the User model. In your terminal create a new branch:

Github Create User

“co” is short for “checkout” which is used to switch between branches. Adding the “-b” and a name at the end creates a new branch and then moves into that new branch for us. You should be able to verify this with the command:

Git Branch

Which should produce:

Github Branch Produce

You’re now in your new branch and can start coding away.

Github Hello World Function

Determining your Git Flow is a huge part of working in a team, but here’s one Git Flow you could adopt for now:

First, determine who’s going to be in charge of handling merging. The less people acting independently on merging the better so for a team of 4 it would probably behoove you to have one official “Reviewer” or “Merge Master”.

Next, have everyone git push their branches:

Git Push

Now go to the GitHub Repo page. You should see the branch you pushed up in a yellow bar at the top of the page with a button to “Compare & pull request”.

Github Pull Request

Click “Compare & pull request”. This will take you to the “Open a pull request” page. From here, you should write a brief description of what you actually changed. And you should click the “Reviewers” tab and select whoever your team decided would be the “Merge Master”. When you’re done, click “Create pull request”.

Github Reviewers

Go ahead and click the “Add your review” button

Github Add Your Review

This will take you to the Pull Request page. How you move forward from here is up to you and your team. If you’re working remotely, this will be your main tool for letting the requester know if they need to make changes or if you’re going to merge their request.

Github Review Changes

When you click “Submit review” on the “Review changes” drop-down your review will now exist as a comment on the pull request thread.

Github Submit Review

When you’re satisfied with the pull request, go to the bottom of the pull request and click “Merge pull request”.

Github Merge Pull Request

You’ll then see a “Pull request successfully merged and closed” message and a button to “Delete branch” which you should click.

Github Delete Branch

Step 4: Rinse, Repeat

Rinse Repeat

And that’s pretty much it. Keep doing the rinse and repeat by adding new branches for new features and then coming together as a team to merge them into master. Keep the master clean and deployable and don’t try to merge more than one branch at a time and you should be good to go.

Summary

Feel free to make a pull request if there’s anything you want to change or if you just want to test out your pull request skills using this repo.

I’d love to hear from you about how GitHub has benefitted you as a team. If you’re just getting started with GitHub, check out our previous posts of our series – Getting Started with GitHub – Hello World,  Free vs Paid Accounts and Tips and Tricks, and learn more about GitHub.

Share this article:
Previous Article Microsoft Edge Dev Gets Sign-in Sync On Linux Next Article Intel’s Investing $20 Billion To Make Chips For Competitors

Related Articles

PowerToys 0.75 released; Environment Variables editor is here

October 31, 2023

Former Halo developer Bungie announces layoffs in wake of game delays

October 31, 2023

Siemens and Microsoft partner to bring GenAI to industries worldwide

October 31, 2023

Leave a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • PowerToys 0.75 released; Environment Variables editor is here
  • Former Halo developer Bungie announces layoffs in wake of game delays
  • Siemens and Microsoft partner to bring GenAI to industries worldwide
  • 43 Microsoft Edge keyboard shortcuts to remember for stylish and speedy web surfing
  • Here is what’s coming to (and leaving) Xbox Game Pass soon

Recent Comments

No comments to show.

Archives

  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010

Categories

  • Announcements
  • Deals
  • Developer
  • Editorial
  • Feature
  • Feature stories
  • Hero-post
  • Hotdeals
  • How-to
  • Latest news
  • Microsoft / office 365
  • News
  • Office 365
  • Onpodcast
  • Opinion
  • Our featured post
  • Polls
  • Review
  • Reviews
  • Videos
OnMSFT.com

OnMSFT.com covers Microsoft news, reviews, and how-to guides. Formerly known as WinBeta, we have been your source for Microsoft news since 1998.

Categories

  • Windows
  • Surface
  • Xbox
  • How-To
  • OnPodcast
  • Gaming
  • Edge
  • Teams

Recent Posts

  • PowerToys 0.75 released; Environment Variables editor is here
  • Former Halo developer Bungie announces layoffs in wake of game delays
  • Siemens and Microsoft partner to bring GenAI to industries worldwide
  • 43 Microsoft Edge keyboard shortcuts to remember for stylish and speedy web surfing
  • Here is what’s coming to (and leaving) Xbox Game Pass soon

Quick Links

  • About OnMSFT.com
  • Contact OnMSFT
  • Join Our Team
© 2010–2026 OnMSFT.com LLC. All rights reserved.
About OnMSFT.comContact OnMSFT