Comandos Git úteis
#git initialization ==>
git init // initialize the folder to git
#git stagging commands ==>
//stagges every thing
git add --all
//stagges every thing as well
git add -A
//stagges every thing as well
git add . **best practice**
// stagges only the directory file
git add to/the/directry.exemple
// stagges every thing with the extension .js
git add * .js
// show changes of files and files which are stagged
git status
// to rollback from the stagging
git reset
// to rollback from the stagging with deleted files
git reset --hard
#git commiting commands ==>
//to commit changes (comments are highly recommended)
git commit -m 'comment as you want'
// to rollback from commit
git reset HEAD~
//to get back to a commit
git checkout {hash-code}
(to check the hash code type git log --oneline)
Exp: git checkout 59f733b
// to get a single file
git checkout {hash-code} to/the/directry.extension
(to check the hash code type git log --oneline)
Exp: git checkout 59f733b script.js
#git branching ==>
// info of branches
git branch
//creat new branch
git branch {name}
Exp: git branch secondry
//to switch branc
git checkout {branch name}
Exp: git checkout secondry
//merge the branch where you are with other one
git merge {branch name} -m 'comment'
#git remote version controlling ==>
//to add origin to the git
git remote add origin {link}
//to clone a repository
git clone origin {branch name}
//push changes
git push origin {branch name}
//pull a branch
git pull origin {branch name}
Evil Emu