GithubHelp home page GithubHelp logo

obsidian-git's Introduction

Obsidian Git

Simple plugin that allows you to backup your Obsidian.md vault to a remote git repository (e.g. private repo on GitHub). This plugin assumes you have existing git repository initialized locally and credentials are setup.

On advantages of backing up your vault with git I suggest reading this amazing article by @tallguyjenks. You can find a "how-to" on git repository setup there as well, this plugin does not expose an interface to initialize git repository (yet).

Synergises well with GitJournal mobile markdown note taking app.

How to use

Requirements

  • initialized git repository
  • credentials are set up
  • remote repository
  • upstream/tracking branch (run git push. Git should prompt you a command)
  • at least one pushed commit

How to create a local repo and push it to GitHub

Features

  • Automatic vault backup every X minutes
  • Pull changes from remote repository on Obsidian startup
  • Assign hotkeys for pulling/pushing changes to a remote repository

Note: it is recommended to exclude obsidian workspace cache files from the repository (or even whole .obsidian directory) due to potential noise in the git history.

If you'd like to do that, scroll to the bottom for a short guide.

Compatibility

Custom plugins are only available for Obsidian v0.9.7+.

Installation

From within Obsidian

If you have Obsidian 0.9.8+, you can install this plugin from "Settings > Third Party Plugins > Obsidian Git".

Manual installation

Download zip archive from GitHub releases page. Extract the archive into <vault>/.obsidian/plugins.

Alternatively, using bash:

OBSIDIAN_VAULT_DIR=/path/to/your/obsidian/vault
mkdir -p $OBSIDIAN_VAULT_DIR/.obsidian/plugins
unzip ~/Downloads/obsidian-git_v1.1.0.zip -d $OBSIDIAN_VAULT_DIR/.obsidian/plugins

SSH Authentication

This is a typical example of a trade-off between security and convenience. [...] The most appropriate solution depends on the usage scenario and desired level of security.

If you want to use SSH and have a passphrase for your ssh-key, you have to add it to the ssh-agent so that Obsidian can access it. Read more at this summary to start ssh-agent on system startup.

Windows installation

Make sure you have 3rd-party software access enabled.

Linux installation

Some users reported issues with Obsidian installed via Snap, because Obsidian runs in a kind of sandbox and can't access git.

Installation via Flatpak or AppImage works.

Tips

Excluding Obsidian cache files from repository

To exclude cache files from the repository, create .gitignore file in the root of your vault and add the following lines:

# to exclude Obsidian workspace settings (including plugin and hotkey configurations)
.obsidian/  
# OR only to exclude workspace cache
.obsidian/workspace 

# Add below lines to exclude OS settings and caches
.trash/
.DS_Store

If you have any kind of feedback or questions, feel free to reach out via GitHub issues or @evrwhr on Obsidian Discord server.

If you like what I do, you could consider buying me a coffee. It is unnecessary, but appreciated :) https://www.buymeacoffee.com/evrwhr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.