Title

Chapter 8 Connecting to GitHub

If you have a paid version of Overleaf, then you can connect your projects to GitHub.

This can be really helpful for better understanding the history of a document overtime, especially if you already use GitHub.

We will not cover what GitHub is and how to use it in this chapter, but this resource can be helpful to get you started.

8.1 Learning Objectives

Learning Objectives: 1. Connect your GitHub and Overleaf accounts, 2. Set up a project to sync with GitHub, 3. Sync changes to and from GitHub

To do so, you need to first click on the home button (looks like an icon of a house on the upper left) to go to the main menu (if you are not already there, this will be the case if you working on a project).

The home button to go to the main menu if you are in a project.

Here you should see a list of any projects you have created or collaborated on.

On the far upper right click on the “Account” button.

Account button on the upper right corner.

Then click on “Account Settings”.

Account settings button under the account button.

Next, scroll down to where you see the heading for “Project Synchronisation.”

Click on the blue “Link” button next to the GitHub section.

Link button to sync with GitHub.

If you already have a GitHub account, you will be asked to grant access.

Now that you have connected your GitHub account with your Overleaf account, you can now set up a project to sync with GitHub.

To do so, first open the project that you would like to sync with GitHub from the project menu (the home icon button).

Next click the Overleaf menu button the far left upper corner.

The Overleaf menu button to go to the main menu if you are in a project.

Then scroll down to the “Sync” section.

The Sync section fo the Overleaf Menu.

The window that pops up about exporting the project to GitHub will then show up. This will create a new repository on GitHub with the files from your project.

Popup when exporting a project to GitHub.

8.2 Syncing files

If you then make a change on GitHub and merge it with the main branch, you can pull these changes back to Overleaf.

To do so, navigate back to the Overleaf Menu in the project on the far left side.

Overleaf menu button on the upper far left.

Scroll back down to the sync section for GitHub.

The Sync section fo the Overleaf Menu.

You will see a window with buttons to sync changes back and forth from GitHub and Overleaf.

GitHub Sync menu

Now to get the change from GitHub you can press the “Pull GitHub changes into Overleaf” button.

To do the opposite and send changes to GitHub from Overleaf, click on the lower button, “Push Overleaf changes to GitHub”.

8.3 Conclusion

We hope that this chapter has given you some guidance about how to connect GitHub with Overleaf.

Here are some of the major take-home messages:

  1. There are 3 steps to sync changes to and from a project on Overleaf with GitHub: connecting the your GitHub account and your Overleaf account, setting up a project to sync with Github, getting changes from each place.
  2. To do these syncs, you will do so for each project individually, and a repository will be made for each Overleaf project.
  3. You can make this repository private or public.
  4. To navigate to the menu to sync changes, go to the menu with the Overleaf icon on the far left upper corner when you have already opened a project.