Notepad/enter/Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md

3.6 KiB

Resources:


Syncing my Obsidian: The Steps I took

My Obsidian files are all stored within Google Drive. So in order to maintain sync while still preserving cloud storage space, I used a few different steps than the guides, and well really it was a culmination of it all.

  1. **Find your Google Drive location and copy the directory path.
pwd | pbcopy
  1. Go to your local projects folder and git init there locally.
mkdir gitlab_sync
cd  gitlab_sync
git init
git branch -m main 
#renamed branch to main insted of master
#less typing xD

  1. Then create a bare clone copy into your copied google drive location.
git clone --bare . ~user/Google\ Drive/My\ Drive/folder/location.git
  1. Then go ahead and make a new remote using this git path inside your local directory.
git remote add NameOfRemote ~user/Google\ Drive/My\ Drive/folder/location.git
  1. Make some changes to your git repository by adding files and commit those changes.
**git** add LICENSE.md
**git** commit -m 'Initial sync version'
  1. Then I pushed the changes to the remote google drive location.
git push -u origin main 
Pushing to Gitlab
  1. Next, I added the (SSH) remote of the gitlab server to upload to as well.
git remote add NameofRemote git@gitblah.com:user/repo.git
  1. I then created another branch for the upload sync to take place.
git branch AnotherBranch
git checkout AnotherBranch #switch into it 
  1. Then follow the instructions outlined on this article. Basically you then create a git clone of it in your new directory by git clone --bare . PATH_TO_GOOGLE_DRIVE_SYNC_FOLDER/ANY_SUBFOLDER_PATH/PROJECT_NAME.git

  2. Then do a git remote by git remote add REMOTE_NAME PATH_TO_GOOGLE_DRIVE_SYNC_FOLDER/ANY_SUBFOLDER_PATH/PROJECT_NAME.git

  3. Add files to stage for commit and commit a message.

git add .
git commit -m "an update message here"
  1. Lastly, push the changes onto your quantum programming repo.
git push -u origin main 

Voila! You should see the changes now over here. Or wherever you decided to set up host the git remote server on.

Syncing via Gitea Server

This can be done locally or via Google Drive. Go to the folder that you'd like to start the git syncing on and run:

git init 

This sets up the git process. Next you have to clone the existing repository and pull .

git clone http://172.104.8.87:3000/shway/Notepad.git

And then pull the existing information from the repo.

git pull 

  • Lastly but not leastly, I stumbled upon Perlite in my search for obsidian sync. !Pasted image 20230206134648.png The sample view of Perlite extension.