How GIT Works ?
Git’s popularity is undeniable, as it has become an essential tool for version control and collaboration, making it nearly impossible to ignore its significance in modern coding workflows.
Happy to share this illustration, and you should probably understand these basic commands to get started:
Git clone
Clone a remote repository to create a local copy.
- git clone https://github.com/utilisateur/nom-du-depot.git
Git checkout
Switch branches or commits in your local repository.
- git checkout my-branch
Git fetch
To fetch updates from the remote repository to the local repository:
git fetch
Fetch and merge changes from the remote repository into the current branch.
- git pull
git reset –hard remote/branch
To reset the current branch to match a specific remote branch:
- git reset –hard origin/my-branch
git merge
To merge changes from one branch into another:
- git merge my-other-branch
git rebase
To reapply your local changes on top of another branch:
- git rebase target-branch
git stash
To temporarily save changes that are not ready to be committed:
- git stash
git add
To stage changes from the working directory to the staging area:
- git add modified-file
git commit -a
To commit all changes, including those in the working directory and the staging area:
- git commit -a -m “Commit message”
git commit
To commit staged changes to the local repository:
- git commit -m “Commit message”
git stash apply
To apply changes from the stash to the working directory:
- git stash apply
git push
To push local commits to the remote repository:
- git push origin my-branch
git rm
To remove files from both the working directory and the staging area:
git rm file-to-remove
À lire aussi
Concevoir une architecture microservices avec Laravel et Docker
Découper une application Laravel monolithique en microservices n'est pas toujours la bonne réponse. Principes, apports de Docker et pièges à éviter.
PHP 8.3 : les nouveautés qui comptent pour les développeurs Laravel
PHP 8.3 apporte plusieurs évolutions utiles au quotidien pour un développeur Laravel : constantes typées, readonly amélioré, nouvelles fonctions. Ce qu'il faut retenir.
Redis : cache, sessions et files d’attente dans Laravel
Redis est l'un des outils les plus utilisés pour accélérer une application Laravel : cache, sessions, files d'attente. Tour d'horizon de ses usages concrets.