Uvažujme, že chceme pridať súbor s kódom pre prvý úlohu z PS1. Podľa inštrukcií pre odovzdávanie PS1 sa tento súbor bude volať  task_1.c, ktorý je navyše uložený v priečinku ps1

1. V priečinku zap-2021-xxxxx vytvoríme priečinos ps1

ab123xy@zapfei:zap-2021-xxxxx $ mkdir ps1

2. Vôjdeme do priečinka ps1 a v ňom vytvoríme súbor s názvom task_1.c ten môžete editovať a vložiť do neho nejaký kód resp. komentár a pod.

ab123xy@zapfei:zap-2021-xxxxx $ cd ps1
ab123xy@zapfei:ps1$ touch task_1.c

3. Pridáme task_1.c medzi súbory, ktoré chceme mať "sledované" GitLabom

ab123xy@zapfei:ps1$ git add task_1.c

4. Potvrdíme zmeny (slangovo: "komitneme")

ab123xy@zapfei:ps1$ git commit -m "Pridal som súbor task_1.c"
  • Ak všetko prebehne správne, uvidíte niečo také
ab123xy@zapfei:ps1$ git commit -m "Pridal som súbor task_1.c"
[master 170e996] Pridal som subor task_1.c
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 ps1/task_1.c

5. Pošleme (slangovo: "pušneme") všetko čo bolo commitnuté na GitLab

ab123xy@zapfei:ps1$ git push
  • Ak všetko prebehne správne, uvidíte niečo také
ab123xy@zapfei:ps1$ git push
 __  ___ .______    __
|  |/  / |   _  \  |  |   Katedra pocitacov a informatiky
|  '  /  |  |_)  | |  |   Fakulta elektrotechniky a informatiky
|    <   |   ___/  |  |   Technicka Univerzita v Kosiciach
|  .  \  |  |      |  |
|__|\__\ | _|      |__|   Internal git repository

UNAUTHORIZED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED.
You must have explicit permission to access or configure this
device. All activities performed on this device are logged and
violations of this policy will be prosecuted under all applicable
statutes plus all applicable civil rules for damages.

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 351 bytes | 351.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To git.kpi.fei.tuke.sk:ondrej.kovac/zap-2020.git
   4c90bf7..170e996  master -> master

Pokiaľ na projekte pracujete z viacerých strojov je nutné pred začatím práce stiahnúť aktualizácie projektu 

Ak je projekt aktuálny uvidíte niečo také 

ab123xy@zapfei:ps1$ git pull
 __  ___ .______    __
|  |/  / |   _  \  |  |   Katedra pocitacov a informatiky
|  '  /  |  |_)  | |  |   Fakulta elektrotechniky a informatiky
|    <   |   ___/  |  |   Technicka Univerzita v Kosiciach
|  .  \  |  |      |  |
|__|\__\ | _|      |__|   Internal git repository

UNAUTHORIZED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED.
You must have explicit permission to access or configure this
device. All activities performed on this device are logged and
violations of this policy will be prosecuted under all applicable
statutes plus all applicable civil rules for damages.

Already up to date.

Ak na projekte prebehli nejaké zmeny, (napr. pridal sa súbor task_2.c), uvidíte niečo také 

ab123xy@zapfei:ps1$ git pull
 __  ___ .______    __
|  |/  / |   _  \  |  |   Katedra pocitacov a informatiky
|  '  /  |  |_)  | |  |   Fakulta elektrotechniky a informatiky
|    <   |   ___/  |  |   Technicka Univerzita v Kosiciach
|  .  \  |  |      |  |
|__|\__\ | _|      |__|   Internal git repository

UNAUTHORIZED ACCESS TO THIS NETWORK DEVICE IS PROHIBITED.
You must have explicit permission to access or configure this
device. All activities performed on this device are logged and
violations of this policy will be prosecuted under all applicable
statutes plus all applicable civil rules for damages.

remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 316 bytes | 316.00 KiB/s, done.
From git.kpi.fei.tuke.sk:ondrej.kovac/zap-2020
   170e996..d0f47e9  master     -> origin/master
Updating 170e996..d0f47e9
Fast-forward
 ps1/task_2.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 ps1/task_2.c


  • No labels