benjamin
Florian Roger 2 years ago
commit b72d593a37

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

@ -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/)
Loading…
Cancel
Save