Installer Oh-My-Bash à l’aide de curl
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
Après l’installation :
source ~/.bashrc
Modifier thème de Bash dans ~/.bashrc
https://github.com/ohmybash/oh-my-bash/wiki/Themes
nano ~/.bashrc
Modifier la ligne
OSH_THEME="font"
en
OSH_THEME="absimple"
Recharger le .bashrc
source ~/.bashrc
# configuration locale d'un projet
git config user.name Matt git config user.email [email protected]
# configuration globale de git
$ git config --global user.name Matt $ git config --global user.email [email protected]
# lire la configuration actuelle
git config --list
# Pour facilité la vision des logs
git config --global pager.log false
dnf install git # redhat/oracle os apt install git # debian os
git --version
git --help man git man git [cmd]
git clone http://url/du/projet
mkdir monprojet git init monprojet
git status
git add mondossier git add monfichier git add .
git commit git commit -m "message"
git log git log --oneline git log --oneline --name-status
mkdir mon projet cd monprojet/ git init touch README.md git add . git commit -m "Init new project" git push origin master
git clone http://url/monprojet.git cd monprojet
git branch develop
git branch -d nom-de-branche
git checkout develop
git checkout -b develop
git branch
# se positionner sur la branche où il va y'avoir la fusion
git checkout master
# faire la fusion de la branch vers celle ou on est positionné
git merge develop
Créér des sous branches dans develop, puis les fusionner dans develop, puis les fusionner dans master # depuis develop
git checkout -b ansible touch test.yaml git add . git commit -m "add config"
# revenir dans la branche supérieur (develop)
git checkout develop git merge ansible
# puis fusionner les divers changements dans master
Donner des numéros de versions à ses commits
git tag v1.0
git tag git show v0.1
# Regarder les logs
git log --oneline
# Tagger le hash du commit souhaité
git tag v0.1 70ae760
# Vérifier le TAG
git show v0.1
ssh-keygen -o -a 100 -t ed25519 -C "VM_TP4_Module9"
$ vi ~/.ssh/config
Host gitlab HostName gitlab.example.com User git Port 22 IdentityFile /home/elisa/.ssh/id_ed25519
Maintenant l'alias gitlab est créer
Vérifier type connexion http ou ssh pour le push
git remote -v
La toute premiere fois pour la branche ou branche qui n'existe pas encore
git push --set-upstream origin nom-de-branche
Ensuite vous pouvez simplement utiliser
git push
Télécharger les modifications
git pull nom-de-branche
git checkout -- readme
La Commande GIT RESET (ne garde pas l'historique des commits, supprime le commit)
git reset --soft HEAD~1
git reset --hard HEAD~1
git revert [hash commit1] [hash commit 2] ...
Command line instructions You can also upload existing files from your computer using the instructions below.
git config --global user.name "user16-eni" git config --global user.email "[email protected]"
git clone [email protected]:user16-eni/user16-project.git cd user16-project git switch -c main touch README.md git add README.md git commit -m "add README" git push -u origin main Push an existing folder
git init --initial-branch=main git remote add origin [email protected]:user16-eni/user16-project.git git add . git commit -m "Initial commit" git push -u origin main
cd existing_repo git remote rename origin old-origin git remote add origin [email protected]:user16-eni/user16-project.git git push -u origin --all git push -u origin --tags