Prefer remote add workflow in README

This commit is contained in:
mpabi
2026-04-26 09:39:02 +02:00
parent 8bedc727af
commit 7a281fb57b
+41 -22
View File
@@ -7,7 +7,7 @@ To repo zawiera launcher do workspace `rv`:
- `workspace.py tmux-container ...` stawia sesje `tmux` z kontenerem w `pane 0` - `workspace.py tmux-container ...` stawia sesje `tmux` z kontenerem w `pane 0`
- `doc/usage.md` opisuje przelaczniki CLI i format listowania - `doc/usage.md` opisuje przelaczniki CLI i format listowania
## Pobranie repo ## Przygotowanie katalogu
Docelowy katalog: Docelowy katalog:
@@ -15,13 +15,13 @@ Docelowy katalog:
~/dev/workspace/rv/tools/rv-launcher ~/dev/workspace/rv/tools/rv-launcher
``` ```
Bootstrap: Bootstrap bez `git clone`:
```bash ```bash
mkdir -p ~/dev/workspace/rv/tools mkdir -p ~/dev/workspace/rv/tools
cd ~/dev/workspace/rv/tools mkdir -p ~/dev/workspace/rv/tools/rv-launcher
git clone http://77.90.8.171:3001/edu-tools/rv-launcher.git cd ~/dev/workspace/rv/tools/rv-launcher
cd rv-launcher git init
``` ```
## Autoryzacja ## Autoryzacja
@@ -38,15 +38,15 @@ Przyklad:
```bash ```bash
git remote add r1 http://u1:TOKEN@77.90.8.171:3001/edu-tools/rv-launcher.git git remote add r1 http://u1:TOKEN@77.90.8.171:3001/edu-tools/rv-launcher.git
git fetch r1 main git fetch r1 main
git switch main git switch --track -c main r1/main
git pull --ff-only r1 main
``` ```
Jesli po zajeciach uzytkownik bedzie chcial wyslac projekt na swoje konto Jesli po zajeciach uzytkownik bedzie chcial wyslac projekt na swoje konto
Gitea, moze zmienic URL remota `r1` na swoje repo: Gitea, lepiej dodac osobny remote `r2`, zamiast przepinac `r1`:
```bash ```bash
git remote set-url r1 http://LOGIN:TOKEN@77.90.8.171:3001/LOGIN/rv-launcher.git git remote add r2 http://LOGIN:TOKEN@77.90.8.171:3001/LOGIN/rv-launcher.git
git push -u r2 main
``` ```
### Droga 2: lokalny `tokens/gitea_tokens.json` ### Droga 2: lokalny `tokens/gitea_tokens.json`
@@ -85,38 +85,57 @@ chmod 700 ~/dev/workspace/rv/tokens
chmod 600 ~/dev/workspace/rv/tokens/gitea_tokens.json chmod 600 ~/dev/workspace/rv/tokens/gitea_tokens.json
``` ```
Jesli token jest trzymany tylko w `tokens/gitea_tokens.json`, remote `r1` moze
byc zapisany bez sekretu:
```bash
git remote add r1 http://77.90.8.171:3001/edu-tools/rv-launcher.git
```
## Fetch i switch ## Fetch i switch
Domyslna galaz launchera to `main`. Domyslna galaz launchera to `main`.
Po sklonowaniu: Wariant preferowany przez `r1`:
```bash
git fetch r1 main
git switch --track -c main r1/main
git pull --ff-only r1 main
```
Jesli repo bylo sklonowane klasycznie i pracujesz przez `origin`, odpowiednikiem
jest:
```bash ```bash
git fetch origin main git fetch origin main
git switch main git switch main
git pull --ff-only git pull --ff-only origin main
```
Jesli pracujesz przez `r1`, odpowiednikiem jest:
```bash
git fetch r1 main
git switch main
git pull --ff-only r1 main
``` ```
Jesli chcesz wejsc na inna galaz, na przyklad `feat/x`, uzyj: Jesli chcesz wejsc na inna galaz, na przyklad `feat/x`, uzyj:
```bash
git fetch r1 feat/x
git switch --track -c feat/x r1/feat/x
```
Wariant przez `origin`:
```bash ```bash
git fetch origin feat/x git fetch origin feat/x
git switch --track -c feat/x origin/feat/x git switch --track -c feat/x origin/feat/x
``` ```
Wariant przez `r1`: ## Wariant alternatywny: `git clone`
Jesli celem nie jest cwiczenie `remote add` i `fetch`, mozna tez uzyc:
```bash ```bash
git fetch r1 feat/x mkdir -p ~/dev/workspace/rv/tools
git switch --track -c feat/x r1/feat/x cd ~/dev/workspace/rv/tools
git clone http://77.90.8.171:3001/edu-tools/rv-launcher.git
cd rv-launcher
``` ```
## Podstawowe komendy ## Podstawowe komendy