105 lines
3.6 KiB
Markdown
105 lines
3.6 KiB
Markdown
Resources:
|
|
- Follow the instructions [here](https://medium.com/analytics-vidhya/how-i-put-my-mind-under-version-control-24caea37b8a5) and document as you go:
|
|
- Refer back to [plists](obsidian://open?vault=Coding%20Tips&file=Computers%2FMac%20OS%20X%2FBBEdit%2Fplist) for a better understanding of implementation and usage.
|
|
- on Cron: https://osxdaily.com/2020/04/27/fix-cron-permissions-macos-full-disk-access/
|
|
- apparently the extension [Obsidian-Git](https://github.com/denolehov/obsidian-git/wiki/Installation#existing-repo) already does this in an easier way now
|
|
- So this is how you [push it to your gitlab](https://about.gitlab.com/blog/2022/03/15/publishing-obsidian-notes-with-gitlab-pages/)
|
|
- Refer to the [Git page](obsidian://open?vault=Obsidian&file=Coding%20Tips%2FComputers%2FTerminal%20Tips%2FGit) on here for more shortcuts.
|
|
|
|
---
|
|
|
|
#### 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
|
|
```
|
|
|
|
2. 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
|
|
|
|
```
|
|
|
|
3. Then create a bare clone copy into your copied google drive location.
|
|
```
|
|
git clone --bare . ~user/Google\ Drive/My\ Drive/folder/location.git
|
|
```
|
|
|
|
4. 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
|
|
```
|
|
|
|
5. Make some changes to your git repository by adding files and commit those changes.
|
|
```
|
|
**git** add LICENSE.md
|
|
**git** commit -m 'Initial sync version'
|
|
```
|
|
|
|
6. Then I pushed the changes to the remote google drive location.
|
|
```
|
|
git push -u origin main
|
|
```
|
|
|
|
##### Pushing to Gitlab
|
|
7. 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
|
|
```
|
|
|
|
8. I then created another branch for the upload sync to take place.
|
|
```
|
|
git branch AnotherBranch
|
|
git checkout AnotherBranch #switch into it
|
|
```
|
|
|
|
9.
|
|
|
|
10. Then follow the instructions [outlined on this article](https://techstreams.medium.com/git-google-drive-simple-git-host-3a84db4fc1fd). 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`
|
|
11. Then do a git remote by `git remote add REMOTE_NAME PATH_TO_GOOGLE_DRIVE_SYNC_FOLDER/ANY_SUBFOLDER_PATH/PROJECT_NAME.git`
|
|
12. Add files to stage for commit and commit a message.
|
|
```
|
|
git add .
|
|
git commit -m "an update message here"
|
|
```
|
|
|
|
13. Lastly, push the changes onto your quantum programming repo.
|
|
```
|
|
git push -u origin main
|
|
```
|
|
Voila! You should see the changes now [over here](https://gitlab.com/shwetha729/quantum-programming). 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. |