Updated: 2023-08-15 11:00:01 + 4
parent
a9a9548e79
commit
21f2f4d9bc
|
@ -49,7 +49,7 @@
|
|||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md",
|
||||
"file": "Machine Tips (Quantum)/Math/Algorithms/Encryption/Encryption Software.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
}
|
||||
|
@ -338,7 +338,7 @@
|
|||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md",
|
||||
"file": "Machine Tips (Quantum)/Math/Algorithms/Encryption/Encryption Software.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
|
@ -355,7 +355,7 @@
|
|||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md",
|
||||
"file": "Machine Tips (Quantum)/Math/Algorithms/Encryption/Encryption Software.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
|
@ -378,7 +378,7 @@
|
|||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md"
|
||||
"file": "Machine Tips (Quantum)/Math/Algorithms/Encryption/Encryption Software.md"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -403,10 +403,12 @@
|
|||
},
|
||||
"active": "368b690b57efb87a",
|
||||
"lastOpenFiles": [
|
||||
"Machine Tips (Quantum)/Math/Algorithms/Encryption/Password Managers.md",
|
||||
"Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/GUIs/Internet/Servers/Cloud Servers/Linode.md",
|
||||
"Coding Tips (Classical)/Project Vault/Obsidian/Tips on Obsidian itself.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/Computers/Linux/KDE/Users.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/About terminal.md",
|
||||
"Machine Tips (Quantum)/Math/Algorithms/Encryption/Password Managers.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/CLI Tools/CLI Tool Collection/Vim/Vim.md",
|
||||
"Machine Tips (Quantum)/Physics/Hardware/MicroControllers/Arduino UNO R4 Wifi.md",
|
||||
"Machine Tips (Quantum)/Physics/Hardware/MicroControllers/Arduino r4 Minima.md",
|
||||
|
@ -433,8 +435,6 @@
|
|||
"Coding Tips (Classical)/Terminal Tips/GUIs/Internet/Servers/Cloud Servers/Cloudron.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/Languages/Fortran 1.md",
|
||||
"Coding Tips (Classical)/Terminal Tips/GUIs/Internet/Servers/Cloud Servers",
|
||||
"Coding Tips (Classical)/Terminal Tips/Languages/Fortran.md",
|
||||
"Machine Tips (Quantum)/Resources/Welcome to Quantum 101.md",
|
||||
"Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230810192136.png",
|
||||
"Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230810193931.png",
|
||||
"Coding Tips (Classical)/Project Vault/Obsidian/imgFiles/Pasted image 20230810193924.png",
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
|
||||
General self-hosted information flow:
|
||||
![[Pasted image 20230716192907.png]]
|
||||
Syncing your obsidian to version control is probably the most efficient way to host your information locally without relying on a cloud provider for unlimited storage. View the process below to see how I got started.
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
Git manual update command Shortcut:
|
||||
>**Git manual update command Shortcut:**
|
||||
```
|
||||
git add .
|
||||
git fetch
|
||||
|
@ -14,80 +9,21 @@ git commit -m "Noted: `date +'%Y-%m-%d %H:%M:%S'`"
|
|||
git push -u origin main
|
||||
```
|
||||
|
||||
But basically this is the self-hosted information flow: A Sketch
|
||||
![[Pasted image 20230716192907.png]]
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
||||
#### OLD METHOD: Making a Repo in GDrive
|
||||
|
||||
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.
|
||||
|
||||
### CURRENT METHOD: Syncing via Gitea Server
|
||||
|
||||
This can be done locally or via Google Drive. However, I will be using Linode to host Gitea to host my obsidian and all my repos locally. Go to the folder on your laptop that you'd like to start the git syncing your Obsidian Vault at and run:
|
||||
This can be done locally or via Google Drive. However, I will be using **[Linode](obsidian://open?vault=enter&file=Coding%20Tips%20(Classical)%2FTerminal%20Tips%2FGUIs%2FInternet%2FServers%2FCloud%20Servers%2FLinode)** to host [Gitea](obsidian://open?vault=enter&file=Coding%20Tips%20(Classical)%2FTerminal%20Tips%2FGUIs%2FInternet%2FRepos%2FGitea) to host my obsidian and all my repos locally. Go to the folder on your laptop that you'd like to start the git syncing your Obsidian Vault at and run:
|
||||
|
||||
|
||||
##### 1. **Setting Up Git repo on your local machine.**
|
||||
|
@ -360,9 +296,77 @@ No need for pesky cloud storage or physical systems anymore. :)
|
|||
Enjoy.
|
||||
|
||||
|
||||
####### ~~OLD METHOD: Making a Gitlab Repo in GDrive ~~
|
||||
DON'T DO THIS I learned the hard way :)
|
||||
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.
|
||||
|
||||
|
||||
|
||||
|
||||
### Extra Tidbits:
|
||||
---
|
||||
|
||||
|
||||
|
@ -375,6 +379,8 @@ Another[ site that you can render ](https://gitlab-org.gitlab.io/frontend/playgr
|
|||
|
||||
For instructions on setting up the front-end of Gitea to your Obsidian Vault head to Browser Talk.
|
||||
|
||||
---
|
||||
|
||||
##### Resources:
|
||||
- Follow the instructions [here](https://medium.com/analytics-vidhya/how-i-put-my-mind-under-version-control-24caea37b8a5) and document as you go:
|
||||
- on [Cron]( https://osxdaily.com/2020/04/27/fix-cron-permissions-macos-full-disk-access/):
|
||||
|
|
Loading…
Reference in New Issue