This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:ostatni:git:start [2017/12/05 12:26] root vytvořeno |
wiki:ostatni:git:start [2020/12/26 20:07] (current) root |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Git ====== | ====== Git ====== | ||
+ | Základní nastavení: | ||
+ | <code bash> | ||
+ | git config --global user.name "Lukas Kaplan" | ||
+ | git config --global user.email " | ||
+ | git config --global credential.helper cache | ||
+ | git config --global credential.helper 'cache --timeout=3600' | ||
+ | git config --global core.editor nano | ||
+ | |||
+ | git config --list | ||
+ | </ | ||
** Vytvoreni noveho projektu v Local repository ** | ** Vytvoreni noveho projektu v Local repository ** | ||
* git init | * git init | ||
+ | * nebo git init jmenoprojektu | ||
+ | |||
+ | ** Pridani Remote Repository *** | ||
+ | * git remote add origin https:// | ||
+ | |||
+ | ** Stažení projektu z GitHubu: ** | ||
+ | |||
+ | * git clone https:// | ||
** Show prikazy ** | ** Show prikazy ** | ||
* git status | * git status | ||
- | * git branch | + | * git branch |
+ | * git remote -v // - vypise cestu k remote repository// | ||
** Pridavani / odebirani souboru z projektu ** | ** Pridavani / odebirani souboru z projektu ** | ||
Line 13: | Line 32: | ||
** Git => Local repository ** | ** Git => Local repository ** | ||
- | * git clone .... | + | * git clone .... //- stažení celého projektu do aktuálního adresáře// |
- | * git pull origin master | + | * git pull |
+ | * git pull origin master | ||
** Local repository => Git ** | ** Local repository => Git ** | ||
* git commit -m " | * git commit -m " | ||
* git push | * git push | ||
+ | * git push origin master | ||
+ | |||
+ | ** Přejmenování / přesun souboru ** | ||
+ | * git mv < | ||
+ | * git status | ||
+ | |||
+ | nebo | ||
+ | |||
+ | * mv < | ||
+ | * git rm < | ||
+ | * git add < | ||
+ | * git status | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ====== Git Školeni CZ.NIC ====== | ||
+ | |||
+ | checkout - prepnuti na jinou vetev | ||
+ | |||
+ | commit - prvni radek = predmet, pak vynechat radek a napsat delsi message | ||
+ | |||
+ | Nedelat zmeny ve stavu detached HEAD (kdyz head ukazuje primo na konkretni commit namisto vetve), kdyzuz si udelat vetev napr. " | ||
+ | |||