GitHub is even more important when working in groups. It allows a groups of developers to:
When working with Git and GitHub in groups, sometimes you will receive errors that you may not be able to resolve. When you’re first learning these errors can be really frustrating. Here is one solution that will always work:
Clone a fresh copy from the GitHub repo:
git clone https://github.com/BrickMMO/tasks.git
Add current changes to the main copy:
git add .
Commit changes to the main copy:
git commit -am "Describe latest changes"
Push the changes to your GitHub repo:
git push origin main
There are better resolutions for some situations. However, this resolution has gotten me out of several jams.
Alternatively, you can Google your error, in which case you will likely find a resolution on Stack Overflow. Or you can post a question to Stack Overflow. Before you post a question, make sure you read the How to Ask a Question in the Stack Overflow documentation.
We will discuss Stack Overflow in more detail during the Stack Overflow Task.
There are multiple methods of working in a groups on the same GitHub repository. You can invite other developers to be contributors of the repo, there are detailed instructions in my github-demo-branching repo. Or you can fork the repo and contribute by submitting Pull Requests. There are details instructions in my github-demo-forking repo.
Here is a basic example of forking a repo:
Fork
. All the default values are fine. Then click Create fork
. You will now have a repository in your GitHub account with the specified name.Then clone your new repo:
git clone https://github.com/<GITHUB_USERNAME>/<REPO_NAME>.git
Add, commit and push these changes:
git add .
git commit -am "<CHANGE_DESCRIPTION>"
git push origin main
Using a browser, navigate to your GitHub forked repo, click Pull requests
, and click New pull request
.
Confirm the branch, review the code you are submitting, and click Create pull request
.
The original GitHub repo owner will be notified of the pull request!
Some of these tasks are an exercise in paying attention to the details. Read the instructions! Follow the instructions carefully and slowly! Copy the examples exactly! Follow the existing naming conventions.
To complete this task, follow these steps:
Create a fork of the BrickMMO contributions repo.
Clone your new repo to your computer. DO NOT clone the BrickMMO repo!
Open up your code editor and point it to the new project folder. It will be named something like forked-contributions
.
Create a page in the students folder. Name this page using your GitHub username (for example codeadamca.markdown
). Use lowercase and kebab case (for example BetVilen_45
becomes betvilen-45.markdown
). Copy the code from another student page as a starting point.
Add your image to the images folder in your repo. Name your image using your GitHub username (for example codeadamca.jpg
). Use the same conventions used in step 3, lowercase and kebab case). Image should be exactly 80 x 80 pixels.
If you have never resized an image, do a quick Google of the term resize image
and you will get lots of suggestions. I would recommend Pixlr or Photoshopo if you have a copy.
Add your information to your page (GitHub, LinkedIn, portfolio, etc…). Do not include personal contact information like email or phone number.
Add a table with a list of BrickMMO projects you have contributed to. At this point just include the Tasks
project and link it to https://tasks.brickmmo.com/
. Here is an example of the projects table:
| Project | |
| ------- | -------------------------------------------------------------------------------- |
| Tasks | [https://tasks.brickmmo.com/](https://tasks.brickmmo.com/) |
Add your name to the student table in the appropriate HTTP5114 class pages. Here is an example of the student table:
|  | Adam Thomas | [codeadamca](students/codeadamca) |
When you are done, push the updates to your GitHub repo:
git add .
git commit -am "Added Adam to HTTP5114"
git push
Use a meaningful commit message.
Then navigate to your forked-contributions
repo in a browser and submit a pull request. You can do this by clicking the Contribute
button and then Pull Request
.
You can check our my page as an example:
https://contributions.brickmmo.com/faculty/codeadamca
Or you can view the Markdown here:
https://github.com/BrickMMO/contributions/blob/main/faculty/codeadamca.markdown
Once your instructor has approved your pull request, copy a link to your forked repo and submit it to the Groups assignment in Blackboard.
For example, my link would be https://contributions.brickmmo.com/faculty/codeadamca.