Zoom Collaborating through GitHub (or similar)

Last updated: January 4, 2023

In this interactive session, I will answer the questions you had while going through the course material, then we will collaborate on a project though GitHub. Please go through the Remotes lesson and make sure you have a GitHub account before joining this interactive session.

This interactive session will be conducted through Zoom.

The meeting ID and password will be emailed to people who registered for this course.

Note that no recording will be made during this session so as not to discourage participation.

Inviting collaborators to a GitHub repo

In your GitHub project webpage, go to the Settings tab, then the Manage access section on the left-hand side. Finally click Invite a collaborator .

Cloning a repo from GitHub

Now, your collaborators can clone the project from GitHub to their machine to start working on it (with Git, everybody has a full version of the project and its history on their machine).

cd /place/where/you/want/to/have/your/project git clone git@github.com:<user>/<repo>.git <name>

<name> is not necessary: this is only if you want to rename the repo on your machine.

Resolving conflicts

Working on the same file is no problem at all as long as different sections of the file are being edited. But if the same section is changed by different people or on different branches, this creates a conflict.

Ideally, you want to avoid conflicts with a good team workflow. But if they arise, there are great tools to help you deal with them.

You can run:

git mergetool

Or you can use one of many GUI applications developed to make Git more friendly (the lucky people who use the Emacs text editor have access to an amazing tool: Ediff).

Whatever tool you use, conflicts will look like some variation of this:

<<<<<<< HEAD
Version of this section of the file on your checked out branch
=======
Alternative version of the same section of the file
>>>>>>> some other version

Merge tools allow you to jump from conflict to conflict within a file and ask you to decide which version you want to choose for each of them (you can also write a combination of the two).

If you don't use any merge tool, you can edit those sections manually in any text editor.

You can also in one swoop keep all of your sections (i.e. the version of the branch you are currently on or HEAD ) or all of "their" sections (the alternative version of the file you are merging into your branch) with:

git checkout –ours <file> git checkout –theirs <file>