-
Notifications
You must be signed in to change notification settings - Fork 105
πͺ Workflow
This is like typing in the account/password, so make sure you follow ALL the steps in set-up-git.
NOTE: SSH-key without passward is preferred to use in this workflow, PLEASE set it properly, PLEASE. Connecting over SSH Section Link
NOTE: Some OS doesn't start ssh-agent by default. Here are some references to start it by default.
- Windows: How to enable OpenSSH Agent to access your github repositories on Windows PowerShell
- Linux: Start ssh-agent on login
- macOS: Proper use of SSH client in Mac OS X
Then you need to add a config telling ssh to use the credential you just created!
Here's how it work:
- Add a file named
config(without any extension) under~/.ssh - Edit it using your preferred text editor, add following text into the file
# github
Host github.com
User git
HostName github.com
PreferredAuthentications publickey
IdentityFile <path to your private key file>
ServerAliveInterval 300
ServerAliveCountMax 10
- Test if it worked using command
ssh -T git@github.com
NOTE: The git@ part matters. ssh -T github.com (without git@) is a common typo that makes GitHub refuse the connection.
This is like creating a folder in GitHub, follow create-a-repo to create a private repo.
NOTE: If you create a public repo, that means everyone on GitHub can see what you put in there. You don't want that, do you?
In your repo page > Add file > Create new file > Name your file: .gitignore.
Type those:
logseq/bak/
logseq/.recycleNOTE: For users before 0.8.11, you can choose to add logseq/pages-metadata.edn in .gitignore or upgrade to 0.8.11 and remove logseq/pages-metadata.edn since it's deprecated. ref
When you edit the same journal/page on two devices, Git treats it as a conflict even if you only appended new blocks on each side. A union merge driver makes Git keep both sides instead of stopping with conflict markers, which fits Logseq's append-heavy journals well.
In your repo page > Add file > Create new file > Name your file: .gitattributes.
Type those:
*.md merge=union
*.org merge=union
NOTE: merge=union concatenates both sides of a conflicting hunk (append-friendly), so nothing is lost β but it can leave duplicate lines that you may need to tidy up later, and it cannot resolve genuinely contradictory edits to the same line. Apply it only to text notes (*.md / *.org); never to assets/binaries, where concatenation would corrupt the file.
Click the green Code button of this repo and Download ZIP, then unzip it for later use.
Set up git proxy:
git config --global http.proxy http://127.0.0.1:1087
git config --global https.proxy https://127.0.0.1:1087Unset git proxy:
git config --global --unset http.proxy
git config --global --unset https.proxy