This commit is contained in:
Florian du Garage Num 2022-11-23 11:08:15 +01:00
commit b72d593a37
2 changed files with 26 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -135,6 +135,18 @@ git push origin main # ou le nom de la branche
## Autres commandes utiles
- Savoir sur quelle branche on se trouve:
```bash
git branch
```
- Créer une nouvelle branche:
```bash
git checkout -b nom-nouvelle-branche
```
- Connaitre l'état du dépôt local:
```bash
@ -153,6 +165,20 @@ git reset --hard HEAD
git diff
```
## Utils
Pour éviter de faire des "git branch" pour savoir dans quelle branche on se trouve, on peut ajouter la référence dans le chemin de notre terminal (Linux) en modifiant les fichier ~/.bashrc:
```bash
sudo nano ~/.bashrc
# y ajouter ces lignes:
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
```
![git-branch](git-branch.png)
## Référence
[Documentation GIT](https://git-scm.com/)