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

Integrating GitHub with HackMD or Obsidian #1

Open
ccbaumler opened this issue Feb 8, 2024 · 0 comments
Open

Integrating GitHub with HackMD or Obsidian #1

ccbaumler opened this issue Feb 8, 2024 · 0 comments

Comments

@ccbaumler
Copy link
Owner

HackMD

To integrating HackMD with GitHub update your HackMD account Integration settings with your GitHub.

Cost of Unlimited HackMD integration is under the Upgrade to Prime Plan:
image


Obsidian

Integrating your obsidian vault to Github
From @bryshalm

Based on this video: Backup you Obsidian Vault for free

Install the Plugin

Obsidian > Preferences > Community plugins >Browse > Obsidian Git by Vinzent > Install > Enable

  1. Go to preferences within Obsidian
  2. Select Community plugins . . . make sure community plugins are enabled
  3. Browse the community plugins
  4. Search Obsidian Git, the one by Vinzent
  5. Select install for Obsidian Git
  6. Go to the Obsidian Git plugin and once installed select enable

Make Sure Git is Installed

  • Go to your terminal
  • Go to the directory you vault operates from, mine: C:\Users\brysh\Documents\Obsidian Vault
  • Make sure git is install with which git. If it come back with a file path, then git is installed

Initialize a Repo

  • First make sure there isn't already a git repo use: git status
  • If it returns fatal: not a git repository for any of the parent directories ): .git you do not have a git repo yet
  • Use git init to initialize an empty Git repository

Get a Github Account

Create a Repo in Github

  • In you git account select New Repo
  • Name the Repository
  • Make sure you select Private
  • Then select Create Repo
  • We are going to follow the directions under: . . . or push an existing repository from the command line
     git remote add origin [email protected]:<githubusername>/<github_vault_name.z>.git
    
     git branch -M main
    
     git push -u origin main
    

###Push to the Repo Once

  • Back in the terminal use git remote add origin [email protected]:<githubusername>/<github_vault_name.z>git
  • Then use git branch -M main
  • We cannot use git push yet because we do not have any commits yet
  • Do git add <a_file_in_your_directory>
  • Do git status, if you want to check that your add is staged
  • Do git commit -m 'initial commit'
    • my git is set, so that I have to add a commit for each commit
  • Now we can do git push -u origin main. This will push the commit to the Github repo. . . if everything goes right

[!warning] If it does not go through may need to generate a new token.

  • To generate a new token go to settings in your GitHub account
  • Go to Developer settings > Personal access tokens > Tokens (classic)
  • Select the scopes (permissions) that your token requires. For cloning repositories, the "repo" scope is typically sufficient.
  • Once you generate the token, make sure to copy and save it somewhere secure, as you won't be able to see it again.
  • Do git push -u origin main again, but use the token as your password.
  • Make sure git is configured, so you do not have to reenter username and password again
  • To configure on Linux use:
git config --global user.name "Github Username"

git config --global user.email [email protected]

After doing this, you may fix the identity used for this commit with:

 git commit --amend --reset-author

Configure the Plugin

  • Go to Obsidian > Preferences > Community plugins > Obsidian Git
  • If it says Obsidian Git not ready, close Obsidian and reopen
  • Select auto backup after file change, I selected 30 mins
  • Most of the selections are standard and do not require change
  • Try to force a backup: make a change to a file > press ctrl+P and search Git push.
  • Select Obsidian Git Push. This will force a push
  • Go to your Github Repo to observe the changes to your repo
    Collapse

Message Bry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant