Skip to content

Version control #116

Description

@fabiospampinato

Native support for version-controlled notes would be awesome.

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

Activity

  1. dawadam commented on Dec 29, 2018

    @dawadam

    Of course, automatic version control (git) !

  2. joschi commented on Dec 29, 2018

    @joschi

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

  3. changed the title [-]Add version control[/-] [+]Version control[/+] on Dec 30, 2018
  4. danielkza commented on Jan 1, 2019

    @danielkza

    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).

  5. obillard commented on Jan 9, 2019

    @obillard

    Hi,
    This feature would be wonderful.

  6. atomi commented on Jan 15, 2019

    @atomi

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

  7. amelandri commented on Jan 16, 2019

    @amelandri

    I would love it!

  8. spikespaz commented on Jan 20, 2019

    @spikespaz

    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!

  9. kinghat commented on Feb 1, 2019

    @kinghat

    this is a wonderful idea

  10. joaochenriques commented on Feb 12, 2019

    @joaochenriques

    Great enhancement.

  11. victorferreira commented on Feb 12, 2019

    @victorferreira

    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: https://github.com/pomber/git-history

  12. added this to the Future milestone on Feb 22, 2019
  13. Pyvonix commented on Apr 12, 2019

    @Pyvonix

    This will be very usefull feature!

  14. rmawatson commented on Jul 23, 2019

    @rmawatson

    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

  15. 2 remaining items

  16. gnzlbg commented on Jan 14, 2020

    @gnzlbg

    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).

  17. fabiospampinato commented on Jan 14, 2020

    @fabiospampinato
    MemberAuthor

    @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.

  18. joaochenriques commented on Jan 14, 2020

    @joaochenriques

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

  19. fabiospampinato commented on Jan 14, 2020

    @fabiospampinato
    MemberAuthor

    @joaochenriques I think it was posted on the subreddit: https://www.reddit.com/r/Notable

  20. amelandri commented on Jan 15, 2020

    @amelandri

    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
    
  21. diogopublio commented on Apr 6, 2020

    @diogopublio

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

  22. fabiospampinato commented on Apr 6, 2020

    @fabiospampinato
    MemberAuthor

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

  23. cryoff commented on Aug 22, 2021

    @cryoff

    Are there any updates planned (as of now)?

  24. EricSDavis commented on Feb 16, 2022

    @EricSDavis

    The "Run on Save" option as described here (https://praveenjuge.com/blog/how-i-take-notes-using-vs-code-and-github/) 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!

  25. benyamindsmith commented on Nov 23, 2022

    @benyamindsmith

    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.

  26. samuelstroschein commented on Mar 4, 2023

    @samuelstroschein

    We (https://github.com/inlang/inlang) 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

  27. MrYutz commented on Mar 4, 2023

    @MrYutz

    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.
    #!/bin/bash
    
    # Set the Git repository URL
    GIT_REPO=""
    
    # Set the script path
    SCRIPT_PATH="/path/to/my_script.sh"
    
    # Set the notes folder path
    NOTES_FOLDER="$HOME/notes"
    
    # Set the list of allowed hostnames
    ALLOWED_HOSTNAMES=("hostname1" "hostname2" "hostname3")
    
    # Get the hostname of the current machine
    CURRENT_HOSTNAME="$(hostname)"
    
    # Set the Git repository commit message
    COMMIT_MESSAGE="Auto-commit from $CURRENT_HOSTNAME"
    
    # Set the sync interval in minutes
    SYNC_INTERVAL="10"
    
    # Save the current working directory
    START_DIR=$(pwd)
    
    # 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
      else
        # If the notes folder already exists, perform a git pull to update it
        cd "$NOTES_FOLDER" && git pull >/dev/null 2>&1
      fi
    
      # 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
        exit
      fi
    
      # 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
      fi
    
      # 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
      fi
    fi
  28. dexterlaw commented on Jun 9, 2023

    @dexterlaw

    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 .

  29. MMK21Hub commented on Jun 10, 2023

    @MMK21Hub

    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: https://chat.notable.app/

  30. asommer70 commented on Mar 14, 2025

    @asommer70

    Would love to have Git integrated with the app. Would love to help make that happen as well.
    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions