54 lines
1.4 KiB
Markdown
54 lines
1.4 KiB
Markdown
tags:: [[logseq]], [[git]]
|
|
|
|
- ## neues Repository online anlegen
|
|
- 
|
|
- Repository dabei mit gitignore initialisieren
|
|

|
|
- **.gitignore**-Datei mit folgenden Inhalt anlegen
|
|
- ```
|
|
logseq/bak/
|
|
logseq/.recycle
|
|
```
|
|
- ## Repository in lokal clonen
|
|
- 
|
|
- git hook **post-commit** anlegen oder kopieren
|
|
- ```
|
|
#!/bin/sh
|
|
|
|
git push origin main
|
|
|
|
```
|
|
- git hook **pre-commit** anlegen oder kopieren
|
|
- ```
|
|
#!/bin/sh
|
|
#
|
|
#
|
|
# Pull before committing
|
|
# Credential handling options:
|
|
# - hardcode credentials in URL
|
|
# - use ssh with key auth
|
|
# - https://git-scm.com/docs/git-credential-store
|
|
# - git credential helper on windows
|
|
|
|
# Redirect output to stderr, uncomment for more output for debugging
|
|
# exec 1>&2
|
|
|
|
output=$(git pull --no-rebase)
|
|
|
|
# Handle non error output as otherwise it gets shown with any exit code by logseq
|
|
if [ "$output" = "Already up to date." ]; then
|
|
# no output
|
|
:
|
|
else
|
|
# probably error print it to screen
|
|
echo "${output}"
|
|
fi
|
|
|
|
git add -A
|
|
|
|
```
|
|
- ## logseq
|
|
- neuen Graph hinzufügen
|
|
{:width 200}
|
|
- test-Eintrag erstellen und "Commit & Push" über das Plugin ausführen
|
|
- |