Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Git, GitHub, and Obsidian - How to Do It

So, you want to collaborate with people, but you need a way to control what makes it in and what doesn’t. And you’d like to be able to see who added what last. And a way to roll things back in case you wind up at a dead end.

My friend, you need Git. Which means you also need a GitHub account. And of we’re going to tie it all in so you can use these tools with Obsidian.md.

Software mis en place

The first semi-daunting task is making sure you have all the right tools and have them installed correctly. That’s what this section is for. We’re going to be installing two software programs, a plugin for one program, and setting up an account at GitHub.

Install Git

Git is version control software (see: fancy way to manage and undo changes to your work). Use the link to download the Git client that matches your system. If you guessed we’re going to install that once downloaded, you’re way ahead of the game. The install is pretty straightforward, but there can be a few “gotchas” so let’s take it step by step. Also, plan on getting up and stretching after getting through this part. Don’t want numb buns numbing your brain.

Note: I’m writing these instructions based on Windows install steps. Things may differ slightly if you’re using a different operating system. Also DO NOT BOTHER INSTALLING GIT-GUI. Just don’t.

Once you’ve downloaded the installer, open it and accept the license agreement by clicking Install.

You’ll then be prompted to choose an install path. The default path is fine, and click Next.

After that it will ask if you want to add any additional components. Again, the defaults are fine so you can click Next.

You’ll then be prompted to select a default (text) editor for Git. Assuming you’re here, reading this, you can safely select Notepad++. Otherwise, select your favorite text editor if you know what you’re doing here.

Next, you’ll be asked for a name to apply to your default branch (see: base source of truth for your work). Here you’re going to want to select Override the default branch name for new repositories and use main as the name. Why do this? Because the default is “master” and I don’t think I have to explain that any further.

The next step is a very important step. The prompt will ask you “How would you like to use Git from the command line?” You’ll want to select Git from the command line and also from 3rd-party software. This is necessary for us to use the Git plugin for Obsidian later.

The next prompt asks you which SSH you’d like to use, and the default is fine. Go ahead and click Next. Then use the OpenSSL library on the next prompt and click Next.

You’re then asked how should Git treat line endings in text files. You’ll want to select Checkout Windows-style, commit Unix-style line endings. (Note: This will likely read differently on Mac, Linux OS).

Next you’re asked which terminal emulator you’d like to use. Select Use MinTTY and click Next.

You’re then asked what the default behavior for git pull should be. Select Default (fast-forward or merge) and then click Next.

Then you are asked for which credential helper you’d like to use. Select Git Credential Manager Core and then click Next.

Use the default options on the last two screens and then finish the installation of Git.

You can verify that Git is installed by searching for “Git BASH” on your system.

Ok, get up and stretch. Next up is creating a GitHub account and linking Git to it.

GitHub and Git integration

The next step is for you to sign up for a GitHub account. Registration and use is free so no worries there.

Once you’ve finished the registration process, login to your GitHub account. We’re going to leave that there for a few steps.

Open up Git BASH in any folder. You may have to launch it with administrator rights depending on your setup.

From there you’ll type in the following commands. Hit Enter after each line.

git config --global user.name "YOUR_GITHUB_USERNAME"

git config --global user.email "YOUR_EMAIL_ADDRESS_ASSOCIATED_WITH_YOUR_GITHUB_ACCOUNT"

Obviously you will replace the all caps text with your actual information.

Git is now tied in with your GitHub account. We’ll leave that all there for now and install Obsidian and the Git plugin for Obsidian next.

Obsidian and the Git Plugin

Download Obsidian from the link for your system and create a new vault in a place you’ll be able to find via File Explorer.

Next, access Settings > Community Plugins. Enable them and search for Obsidian Git. When you find it, install it. Note: You will need to repeat this installation for each vault you create.

Create a test or your first text file in your vault and then let it save.

We’re tying it all together in the next step.

Initializing your Repository

Return to GitHub and create a new repository with the same name as you named your vault. Don’t initialize with a README. When that’s done you’ll be presented a new screen with several terminal commands. We’re going to take the second path.

Open Git BASH in your vault’s folder on your computer. Then complete the following commands:

 git init
 git remote add origin https://github.com/YOUR_USER_NAME/YOUR_REPOSITORY_NAME.git
 git branch -M main
 git push -u origin main

The commands should not produce any errors. If they do you might have accidentally added a README (which deleting and a rerun of the git init should fix), typed a path incorrectly, etc.

One that is common to occur after running git push -u origin main may look something like this: failed to push some refs error

To resolve it you’ll want to run

git pull origin main

You’ll see something like this: successful pull message

You’ll then run this:

git push -u origin main

Which should result in an output like this: successful push

On success you should be able to now return to Obsidian. Hit CTRL+P and you’ll get Obsidian command prompt.

Start typing Obsidian Git: Commit all changes. It should give you a small pop up message that your file has been committed. Hit CTRL+P again and this time type in Obsidian Git: Push. You should receive another message that you have successfully pushed those changes.

Return to your GitHub repository and check to see if your changes have made it. They should be there along with the rest of your file structure for your vault.

Command(s) of your Environment

When working you’ll primarily create new branches, switch branches, commit changes, push changes, and pull changes.

Branches are environments where only your changes exist. It is important when collaborating to work in your own branch first and then make a pull request to merge your changes in with main. Pull request meaning, you are requesting that the main branch pull your changes in. That will trigger a review process within GitHub so that you can pick what gets merged.

To create a new branch in Obsidian, hit CTRL+P and type Obsidian Git: Create new branch. That will prompt you to name your branch and then switch you over to that environment.

You’ll then commit your changes and push them to that branch as demonstrated in the last step until you’re done. Then you’ll make your pull request in GitHub.

Once your changes have been approved you’ll want to switch back to the main branch in your local version of the vault and run Obsidian Git: Pull. This will pull down the freshly merged changes into your version of main.

For more detailed instructions on using Git in general you can look at the documentation here. There are also patterns you can follow to minimize conflicts between branches by using a reliable branching model. Both of these are outside the scope of this post.

Final Thoughts

If you’ve made it this far without losing your mind, congratulations! You’ve unlocked a whole new dimension of collaboration possibilities. You now have a built in strategy for working with others and taking only what works into your main branch.

There are even ways to display your Obsidian files nicely using templates. Not something I’ve done yet but it’s on the agenda.

I’m currently using Obsidian to create The Real Housespouses of X. You can checkout the GitHub page where I’m storing the work so you can read the extant drafts.

Plus the canvas is just so pretty.

Canvas for The Real Housespouses of X

I hope this has been useful.

Let me know if I missed something or if you need some assistance in the comments.

Support this post

Did you like this post? Tell us

In this post

Leave a comment

Log in with your itch.io account to leave a comment.

Mentioned in this post

a Real Housewives inspired adventure module for Liminal Horror