From: Niki Roo Date: Wed, 3 Jul 2024 13:27:52 +0000 (+0200) Subject: update mkdocs X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=b41ce49e2b374998eede967fbcd2b5e9ac6f605d;p=notes.git update mkdocs --- diff --git a/git.md b/git.md index f5bda75..ca26282 100644 --- a/git.md +++ b/git.md @@ -1,50 +1,62 @@ # Git Set upstream: + * `git push --set-upstream remote_name local_branch` * `git pull --set-upstream remote_name local_branch` Delete branch: + * `git branch -d xxx` * `git branch -D xxx` (force delete) * `git push MY_REMOTE --delete XXX` * `git push MY_REMOTE :XXX` (identical to above) -Move branch +Move branch: + * `git checkout OLD_NAME` * `git branch -m NEW_NAME` Active branch in a bare repository: + * see `repo/HEAD` (and change it if needed) Create a new branch and switch to it: + * `git checkout -b BRANCH` Merge unrelated repositories: + * `git pull ../other/ master --allow-unrelated-histories --no-rebase` ## Submodules At start: + * `git clone XXX --recurse-submodules` At new one: + * git submodule add https://github.com/... path * `./` is allowed, `.` is not *but only on remote paths, not local paths* * `../other-prj.git` is also allowed Manually: + * git submodule init * git submodule update (--recursive) Or in one command: + * git submodule update --init (--recursive) If problems: + * git submodule deinit (--all) If head detached: + * `git branch -u / ` * `git checkout -b --track /` diff --git a/mkdocs/site b/mkdocs/site index 222a230..51b84c7 160000 --- a/mkdocs/site +++ b/mkdocs/site @@ -1 +1 @@ -Subproject commit 222a2306973db10bc76ff67f16fb1f6a44832a1f +Subproject commit 51b84c72be735fd8efcb880b1af1e9aac4ac4dc8 diff --git a/mkdocs/update.sh b/mkdocs/update.sh index a28c1e6..a4a6aa7 100755 --- a/mkdocs/update.sh +++ b/mkdocs/update.sh @@ -4,9 +4,14 @@ DDIR=/home/user/Notes if [ "$1" = "" ]; then # Host - cd "`dirname "$0"`" || exit 42 + cd "`dirname "$0"`" + if [ $? != 0 ]; then + echo Cannot find directory \ + | tee mkdocs/error.txt >&2 + exit 42 + fi cd .. - rm -f mkdocs/ok + rm -f mkdocs/ok mkdocs/error.txt touch mkdocs/wip OPTS="-v $PWD:$DDIR:rw" /opt/docker/launch.sh \ --start $DDIR/mkdocs/update.sh mkdocs \ @@ -20,21 +25,26 @@ if [ "$1" = "" ]; then cd mkdocs/site git add . if [ $? != 0 ]; then - echo Failure to add newly built html site >&2 + echo Failure to add newly built html site \ + | tee mkdocs/error.txt >&2 exit 20 fi git commit -m "`date +"Auto commit %Y-%m-%d %H:%M"`" if [ $? != 0 ]; then - echo Failure to commit to git >&2 + echo Failure to commit to git \ + | tee mkdocs/error.txt >&2 exit 21 fi git push nikiroo html if [ $? != 0 ]; then - echo Failure to push html branch to nikiroo >&2 + echo Failure to push html branch to nikiroo \ + | tee mkdocs/error.txt >&2 exit 22 fi + cd - >/dev/null else - echo Failed to update, no remote copy started: $rep >&2 + echo Failed to update, no remote copy started: $rep \ + | tee mkdocs/error.txt >&2 fi rm -f mkdocs/wip exit $rep @@ -49,5 +59,6 @@ cd cp "$DDIR/mkdocs/mkdocs.yml" "$HOME/" || exit ln -s "$DDIR" docs || exit mkdocs build -d "$DDIR"/mkdocs/site || exit +rm -rf "$DDIR"/mkdocs/site/mkdocs || exit touch "$DDIR/mkdocs/ok"