1
GIT & GITLAB :
I. Create project :
Create new project
II. Installation & configuration :
Install git
Git --version
Git config --global [Link] ‘’YOUR_EMAIL’’
Git config --global [Link] ‘’YOUR_NAME’’
Git config --global [Link]
Git config --global [Link]
III. Create a demo project & add it to git :
Créer un chemin composé de deux dossiers GitLab/MyProject
Ouvrir git bash & CD (../GitLab/)
CD (../GitLab/MyProject/)
git init (va créer un dossier masqué « .git »)
git statuts (nothing to commit)
on va tester et ajouter un fichier « [Link] » dans (MyProject/)
git statuts
IV. Ajouter les modifications dans « .git » :
git add .
git statuts
git commit –m ‘’message’’ (pour enregistrer ces modifications dans
l'historique avec un message décrivant les changements.)
git push –u ‘’https url’’ master
git pull
GIT & GITLAB | Younes DBAGHI
2
V. Cloner un projet avec url Https :
git clone ..url..
VI. How to create a SSH (Secured shell) Key :
Used for authentification
When you set SSH Key, you can connect to GitLab server without using
username and password
Git bash
(ssh-keygen -t ed25519 –C ‘’0helloworld4@[Link]’’) & press enter,
enter, enter
clip < ~/.ssh/id_ed25519.pub (cmd)
go to GitLab > settings or préférences > SSH Keys
ouvrir c/utilisateurs/admin/.ssh/….pub (copy)
past it in SSH Key
git clone …url ssh…
if problem do this cmd and reclone (ssh-keyscan -t ed25519 [Link]
>> ~/.ssh/known_hosts)
VII. How to create branches :
git branch (pour voir tous les branches)
git checkout –b new_branch (pour créer une nouvelle branche)
git checkout branchName (pour basculer à une autre branche)
Supposons qu’on est dans branche (master) :
git merge branch_name (pour ajouter tous les modifications de
branch_name à master)
git push –u ‘’https url’’ master
GIT & GITLAB | Younes DBAGHI