Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version control #116

fabiospampinato opened this issue Dec 28, 2018 · 28 comments

Version control #116

fabiospampinato opened this issue Dec 28, 2018 · 28 comments
enhancement New feature or request


Copy link

Native support for version-controlled notes would be awesome.

We should probably leverage git to enable this and other features.

@fabiospampinato fabiospampinato added the enhancement New feature or request label Dec 28, 2018
Copy link

dawadam commented Dec 29, 2018

Of course, automatic version control (git) !

Copy link

joschi commented Dec 29, 2018

Maybe isomorphic-git would be a viable library to support this.
It's also used by Antora.

@fabiospampinato fabiospampinato changed the title Add version control Version control Dec 30, 2018
Copy link

Hooks for calling custom scripts when relevant changes are made to notebooks would already help quite a bit with Git support (at least until a full-fledged solution can be developed).

Copy link

obillard commented Jan 9, 2019

This feature would be wonderful.

Copy link

atomi commented Jan 15, 2019

Agree with @danielkza
All that I need is to commit and push changes immediately after doing an edit.

Copy link

I would love it!

Copy link

Not creating a duplicate issue. After reading the tutorial, came to support this! I think integration with Git is all that would be required, no custom version control necessary.

Thanks for some awesome software!

Copy link

kinghat commented Feb 1, 2019

this is a wonderful idea

@bendem bendem mentioned this issue Feb 4, 2019
Copy link

Great enhancement.

Copy link

Today I came across this tweet and seems like a good example of what we could have with Notable version control: a timeline with all the history for a particular note.

Here's a link to the repo:

Copy link

Pyvonix commented Apr 12, 2019

This will be very usefull feature!

Copy link

rmawatson commented Jul 23, 2019

Git integration would be really great. Currently I have just init a git repo in the .noteable dir and I'm manually commiting and pushing every so often. But having either a git button per note to commit it (or commit & push) or a global commit push all changes to all notes would be nice

Copy link

vogler commented Jul 24, 2019

Until something is integrated, the following works:

Copy link

skyox commented Sep 27, 2019

This will be very Usefull and Wanderfull feature!

Copy link

gnzlbg commented Jan 14, 2020

It would be awesome if one could setup the App to use a particular github (or gitlab, or whatever) repo for backup, and this automatically synced notes across devices (e.g. one modifies a note in phone, the modification gets automatically committed to git, and the desktop app automatically pulls it).

Copy link
Member Author

@gnzlbg you pretty much can do that already, somebody posted a script somewhere (I don't remember where) that automatically commits changes, pushes them and fetches changes.

Copy link

@fabiospampinato do you have any clue where can we start to search that script?

Copy link
Member Author

@joaochenriques I think it was posted on the subreddit:

Copy link

It was me. this is the script for Windows. I've scheduled it to run every 15 minutes

@echo off

for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
	set day=%%i
	set month=%%j
	set year=%%k

for /f "tokens=1-4 delims=: " %%i in ("%time%") do (
	set hour=%%i
	set minute=%%j

cd C:\Path\To\Your\Notebook

git pull && git add --all && git commit -m "Auto update %year%-%month%-%day% %hour%:%minute%" && git push origin master

Copy link

guys, is the plan here to have that built in in future version, or that is currently discarded ?

Copy link
Member Author

@diogopublio this issue is the "Future" milestone so I'd say it's planned, if it were discarded I would have closed this issue.

Copy link

cryoff commented Aug 22, 2021

Are there any updates planned (as of now)?

Copy link

The "Run on Save" option as described here ( looks appealing. After setting up a repository, it would be nice for the save command to push to GitHub in addition to showing that saved alert box.

This is an awesome app!

Copy link

It would be cool if the terminal can be opened up in it (as an option of course) so that its possible to do version control locally.

Copy link

We ( use git as the backend and plan to build an easy-to-use git SDK. That SDK might be of benefit to notable in the future. Feel free to reach out

Copy link

MrYutz commented Mar 4, 2023

It was me. this is the script for Windows. I've scheduled it to run every 15 minutes

Thanks for the inspiration!

I created a version for zsh that does the following interesting things:

  • pull from git if the note folder doesn't exist
  • commit only if there are changes
  • runs on allowed hostnames. I use some startup scripts in docker etc and don't want notes on those hosts
  • creates a cronjob to run every $SYNC_INTERVAL minutes
  • auto commits and pushes changes.

# Set the Git repository URL

# Set the script path

# Set the notes folder path

# Set the list of allowed hostnames
ALLOWED_HOSTNAMES=("hostname1" "hostname2" "hostname3")

# Get the hostname of the current machine

# Set the Git repository commit message

# Set the sync interval in minutes

# Save the current working directory

# Check if the current hostname is in the list of allowed hostnames
if [[ " ${ALLOWED_HOSTNAMES[@]} " =~ " ${CURRENT_HOSTNAME} " ]]; then
  # If the hostname is allowed, proceed with the script
  # Check if the notes folder exists in the user's home directory
  if [ ! -d "$NOTES_FOLDER" ]; then
    # If the notes folder doesn't exist, perform a git clone
    git clone "$GIT_REPO" "$NOTES_FOLDER" >/dev/null 2>&1
    # If the notes folder already exists, perform a git pull to update it
    cd "$NOTES_FOLDER" && git pull >/dev/null 2>&1

  # Check if the notes folder is a Git repository
  if [ ! -d "$NOTES_FOLDER/.git" ]; then
    # If the notes folder is not a Git repository, exit the script

  # Return to the original working directory
  cd "$START_DIR" >/dev/null 2>&1

  # Check if there are changes in the notes folder
  if [ -n "$(cd $NOTES_FOLDER && git status --porcelain)" ]; then
    # If there are changes, commit and sync with Git
    cd "$NOTES_FOLDER" && git add -A  >/dev/null 2>&1 && git commit -m "$COMMIT_MESSAGE"  >/dev/null 2>&1 && git push >/dev/null 2>&1

  # Check if the cron job is already running
  if ! crontab -l 2>/dev/null | grep -q "$SCRIPT_PATH"; then
    # Add the cron job to the crontab file with the sync interval
    (echo "*/$SYNC_INTERVAL * * * * $SCRIPT_PATH") | crontab - >/dev/null 2>&1

Copy link

hi, i am no it. but i like this tool, and i wanna konw ,how to save the picture upload ,and the picture like can be orgnize for other online markdown tools .

Copy link

Hi @dexterlaw! It looks like you have a help request unrelated to this issue. I'd recommend asking about that in Notable's Discord server:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
enhancement New feature or request

No branches or pull requests