This commit is contained in:
Miloslav Ciz 2023-11-07 21:39:59 +01:00
parent b1f6998983
commit 8ba58ae822
2 changed files with 31 additions and 1 deletions

30
git.md
View file

@ -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).