From 8ba58ae8229f3307ff00a59f2668f0ead1fed2c2 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Tue, 7 Nov 2023 21:39:59 +0100 Subject: [PATCH] Update --- git.md | 30 ++++++++++++++++++++++++++++++ regex.md | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/git.md b/git.md index ecbbf25..57e8632 100644 --- a/git.md +++ b/git.md @@ -34,3 +34,33 @@ TODO - `git diff` - `git apply diff_file` - *weird error*: just look it up on stack overflow + +### Set Up Your Own Git Server + +WIP + +on server: + +``` +mkdir myrepo +cd myrepo +git init --bare +``` + +on client you can clone and push with ssh: + +``` +git clone ssh://user@serveraddress:/path/to/myrepo +cd myrepo +... # do some work +git commit -m "blablabla" +git push +``` + +you can also make your repo clonnable via HTTP if you have HTTP server (e.g. [Apache](apache.md)) running, just have address `http://myserver/myrepo` point to the repo directory, then you can clone with: + +``` +git clone http://myserver/myrepo +``` + +IMPORTANT NOTE: for the HTTP clone to work you need to do `git update-server-info` on the server in the repo directory after every repo update! You can do this e.g. with a git hook or [cronjob](cronjob.md). \ No newline at end of file diff --git a/regex.md b/regex.md index a1328c9..cbc6863 100644 --- a/regex.md +++ b/regex.md @@ -30,7 +30,7 @@ There exist different standards and de-facto standards for regular expressions, |`[`*A*`-`*B*`]`| like `[` `]` but specifies a range | everywhere | `[3-5]` matches `3`, `4` and `5` | | `[^`*S*`]` | matches any char. NOT from set *S* | everywhere | `[^abc]` matches `d`, `e`, `A`, `1` etc. | |`{`*M*`,`*N*`}`| *M* to *N* repetitions of *expr* |escape (`\{`, `\}`) in basic| `a{2,4}` matches `aa`, `aaa`, `aaaa` | -|*exp1*`|`*exp2*| *exp1* or *exp2* | escape (`\|`) in basic | `abc|def` matches `abc` or `def` | +|*e1*|*e2*| *e1* or *e2* | escape in basic |ab|cd match. `ab` or `cd`| | `\`*n* |backref., *n*th matched group (starts with 1)| extended only | `(..).*\1` matches e.g. `ABcdefAB` | |`[:alpha:]` | alphabetic, *a* to *z*, *A* to *Z* | Posix (GNU has `[[` `]]` | `[:alpha:]*` matches e.g. `abcDEF` | |`[:alnum:]` | | same as above | |