MED2 Github Exercises

Before the exercise, please make sure that you have installed Unity version 2020.3.28f1, Github Desktop, and a source-code editor (such as Visual Studio Code). Also make sure that you have created a Github account on www.Github.com.

1. Fork and clone repository

  • Go together in groups of two.
  • One person from the group should:
    • Fork this Github repository by pressing the button in the top right corner:
    • Add the other group member by going to Settings > Collaborators > Add people.
  • The other group member should then:
    • Accept the invitation to join the newly created repository (excluding the person who forked the project).
  • Both group members should then:
    • Clone the repository by going to Github Desktop and choosing "Clone repository" – then choose the repository that was just created.

You might want take a look at this Github Desktop Guide.

2. Pull and push

  • Open the Unity project "Github Unity Exercise" located in the cloned repository.
  • Locate and open the script "ExerciseCode.cs".
  • on one computer, edit the code to add the function call "PassByValue(myVariable);" on line 14, as indicated in the code. Save and press play in Unity to observe the result in the console.
  • Go back to Github Desktop. Here you can now see the changes you have made. Write a summary of the change and press "Commit to main". Upload your local changes by pressing the "Push" button at the top.
  • Now, on the other computer, go to Github Desktop and press "Fetch" at the top. Then press "Pull". This fetches and downloads the content on the remote repository and updates your local repository to match the content. Go to the Unity project and open the "ExerciseCode.cs" script to see that you now have the updated code.

3. Merge conflicts