Skip to content

Commit

Permalink
docs: remove usage of backup command
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Oct 20, 2024
1 parent 5483a50 commit 661d94c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
25 changes: 13 additions & 12 deletions docs/Features.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
## Source Control View

Open it using the "Open Source Control View" command. It lists all current changes like when you run `git status`. It provides the following features
- See every file's diff
Open it using the "Open source control view" command. It lists all current changes like when you run `git status`. It provides the following features

- Stage/Unstage individual files
- Discard any changes to a specific file
- Switch between list and tree view using the button at the top
- Open the diff view for changed files
- Stage/Unstage all files
- Push/Pull
- Commit and [[Start here#Backup|Backup]]
- Commit or [[Start here#commit-and-sync|commit-and-sync]]
- Switch between list and tree view using the button at the top

## History View

Open it using the "Open History View" command. It behaves like `git log` resulting in a list of the last commits. Each commit entry can be expanded to see the changed files in that commit. By clicking on a file, you can even see the specific diff.
Open it using the "Open history view" command. It behaves like `git log` resulting in a list of the last commits. Each commit entry can be expanded to see the changed files in that commit. By clicking on a file, you can even see the diff.

## Line Authoring

For each line, view the last time, it was modified: [[Line Authoring|Line Authoring]]. Technically known as `git-blame`.

## Automatic Backup
## Automatic commit-and-sync

See [[Start here#Backup|Backup]] for an explanation of the term. The goal of automatic Backups is that you can focus on taking notes and not to care about saving your work, because this plugin will take care of it.
There are multiple ways to trigger an automatic backup. The default is a basic interval, resulting in backing up your files every X minutes. Use the "Vault backup interval" setting for that. The interval works across Obsidian sessions to ensure the backup is always run. For example, if you set a 15 minutes interval, you don't have to keep Obsidian open for 15 minutes. If you close Obsidian before the interval end, the backup will automatically run the next time you start Obsidian.
See [[Start here#commit-and-sync|commit-and-sync]] for an explanation of the term. The goal of automatic commit-and-sync is that you can focus on taking notes and not care about saving your work, as this plugin will take care of it.
There are multiple ways to trigger an automatic commit-and-sync. The default is a basic interval to run commit-and-sync every X minutes. Use the "Auto commit-and-sync interval" setting for that. The interval works across Obsidian sessions to ensure opening Obsidian only for short times doesn't prevent running commit-and-sync. For example, if you set a 15 minutes interval, you don't have to keep Obsidian open for 15 minutes. If you close Obsidian before the interval end, the commit-and-sync will automatically run the next time you start Obsidian.

Another method is to enable "Auto backup after file change". This waits X minutes after your last change for the backup. This is useful if you don't want to get interrupted by a backup while typing.
Another method is to enable "Auto commit-and-sync after stopping file edits". This waits X minutes after your latest change for the commit-and-sync. This is useful if you don't want to get interrupted by a commit while typing.

The last mode is the "Auto backup after latest commit" setting. This sets the last backup timestamp to the last commit. By default, the plugin only compares with it's own last run backup. So if you manually commit and want the backup timer to reset, enable this setting.
The last mode is the "Auto commit-and-sync after latest commit" setting. This sets the last commit-and-sync timestamp to the latest commit. By default, the plugin only compares with it's own latest run of commit-and-sync. So if you manually commit and want the commit-and-sync timer to reset, enable this setting.

## Commit message

The plugin uses [momentjs](https://momentjs.com/) for formatting the date, so read through their documentation on how to construct your date placeholder.

## Submodules Support

Since version 1.10.0 submodules are supported. While adding/cloning new submodules is still not supported (might come later), updating existing submodules on the known "Create Backup" and "Pull" commands is supported. This works even recursively. "Create Backup" will cause adding, commit and push (if turned on) all changes in all submodules. This feature needs to be turned on in the settings.
Since version 1.10.0 submodules are supported. While adding/cloning new submodules is still not supported (might come later), updating existing submodules on the known "Commit-and-sync" and "Pull" commands is supported. This works even recursively. "Commit-and-sync" will cause adding, commit and push (if turned on) all changes in all submodules. This feature needs to be turned on in the settings.

Additional **requirements**:

- Checked out branch (not just a commit as it is when running `git submodule update --init`)
- Tracking branch is set up, so that `git push` works
- Tracking branch needs to be fetched, so that a `git diff` with the branch works
- Tracking branch needs to be fetched, so that a `git diff` with the branch works
4 changes: 2 additions & 2 deletions docs/Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ The instructions assume you are using [GitHub](https://github.com), but can be e
8. Under the "Authentication/Commit Author" section, fill in the username on your git server and your password/personal access token.
9. Don't touch any settings under "Advanced"
10. Exit plugin settings, open command palette, choose "Git: Clone existing remote repo".
11. Fill in repo URL in the text field and press the repo URL button below it. The repo URL is NOT the URL in the browser. You have to append `.git`. - `https://github.com/<username>/<repo>.git
11. Fill in repo URL in the text field and press the repo URL button below it. The repo URL is NOT the URL in the browser. You have to append `.git`. - `https://github.com/<username>/<repo>.git`
- E.g. `https://github.com/denolehov/obsidian-git.git`
12. Follow instructions to determine the folder to place repo in and whether an `.obsidian` directory already exits.
13. Clone should start. Popup notifications (if not disabled) will display the progress. Do not exit until a popup appears requesting that you "Restart Obsidian".

### Clone via Working Copy on iOS

Depending on the size of your repository and your device, Obsidian may crash during clone via the plugin. Alternatively, the initial clone can be done via [Working Copy](https://workingcopy.app/). None that this a paid app. The usual backup in can then be done via the plugin. The following guide assumes you don't commit your `.obsidian` directory.
Depending on the size of your repository and your device, Obsidian may crash during clone via the plugin. Alternatively, the initial clone can be done via [Working Copy](https://workingcopy.app/). None that this a paid app. The usual commit-and-sync can then be done via the plugin. The following guide assumes you don't commit your `.obsidian` directory.

1. Make sure any outstanding changes on all devices are pushed and reconciled with the remote repo.
2. Install Obsidian for Android or iOS.
Expand Down
2 changes: 1 addition & 1 deletion docs/Start here.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Syncing is the process of pulling and pushing changes to and from a remote repos

### Commit-and-sync

Commit-and-sync is the process of staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync. It's recommended you set it up from the plugin's settings to be run automatically every X minutes. You can also disable the pulling or pushing part from the "Commit-and-sync" section in the plugin's settings. This reduces the "commit-and-sync" action to either a "commit and pull" or just commit action.
Commit-and-sync is the process of staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync. It's recommended you set it up from the plugin's settings to be run automatically every X minutes. You can also disable the pulling or pushing part from the "Commit-and-sync" section in the plugin's settings. This reduces the "commit-and-sync" action to either a "commit and pull", "commit and push" or just commit action.
6 changes: 3 additions & 3 deletions docs/Tips-and-Tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ There's also the `Edit .gitignore` command that will open the file in a modal.

## Usage with Obsidian Sync

A common use case for using git and Obsidian Sync is to use Sync to actually sync between all your devices and git as a form of backup and version history.
A common use case for using git and Obsidian Sync is to use Obsidian Sync to actually sync between all your devices and Git as a form of backup and version history.

### Use Git plugin only on one device

In case you are syncing your enabled plugins and their settings, the Git plugin is enabled and running even though the `.git` directory doesn't exist or you don't want to run auto backups on that device. To fix this, you can enable the "Disable on this device" option under "Advanced" in the plugin settings. That setting is not synced to other devices.
In case you are syncing your enabled plugins and their settings, the Git plugin is enabled and running even though the `.git` directory doesn't exist or you don't want to run automatics on that device. To fix this, you can enable the "Disable on this device" option under "Advanced" in the plugin settings. That setting is not synced to other devices.

### Use Git plugin, but not to pull your files

Another use case might be that you don't want to update your files on pull, because Obsidian Sync already updated your files. You can still commit/push/backup. To accomplish this use "Other sync service" as "Sync Method" under "Backup". This only updates the HEAD to the latest commit on pull, but doesn't change your files at all.
Another use case might be that you don't want to update your files on pull, because Obsidian Sync already updated your files. You can still commit/push/commit-and-sync. To accomplish this use "Other sync service" as "Merge strategy" under "Pull". This only updates the HEAD to the latest commit on pull, but doesn't change your files at all.

0 comments on commit 661d94c

Please sign in to comment.