Créer un repo
git init Git a maintenant initialisé un repo avec toutes les infos dans un dossier .git
ls .git Pour ceux sur vscode je vous invite à ouvrir le dossier courant dans votre éditeur
code .et créez un fichier en y ajoutant du texte. puis faites:
git statusBranches
Pour voir sur quelle branche on se situe
git branch --show-currentCommit
Avant de pouvoir commit un fichier il faut pouvoir “stage” le(s) fichier(s) en question:
git status
git add first.md
git statusEt enfin commit:
git commit -m 'first commit'Pour nommer les commits il existe une convention
- Conventional Commit
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests
Créer une branche à partir d’une autre
git checkout -b feat/add-featureVous pouvez ajouter le numéro du ticket si ca peut vous aider
git checkout -b feat/API-001-add-new-feature