Some other useful command to know
commit and add at the sames time
git commit -am
git log
If you need to keep track of all the canges you made to your code
git log
git reset
take a version of the git repo and revert it to an older state
git reset --hard <commit>
git reset --hard origin/master
git reset
take a version of the git repo and revert it to an older state
git reset --hard <commit hash>
git reset --hard origin/master
git branch
Show on what branch i currently worked
git branch
git checkout
create a new branch
git checkout -b nomDeLaNouvelleBranche
move to another branch
git checkout nomDeLaBranche
git merge
use to merge two branch
git merge
git revert
Use to revert to a previous commit.
git revert <Num_dernier_commit>
revenir 2 commit en arrière
git revert HEAD-2..HEAD
git diff
Use to check dif between branch
git remote add
Add a remote repo
git remote add origin [email protected]:user/depot.git