git config --global user.name "{username}"
git config --global user.email "{email}"
git config --global core.ignorecase false
git config --global core.editor {subl}
git config --global merge.tool {filemerge}
git config --list
Help
git help config
git help push
git help pull
git help branch
Status
git status
List branchs
git branch -a
*
Current branch.
Create branch
git branch {branch-name}
git checkout {branch-name}
git checkout -b {branch-name} # With switch
Remove branch
git branch -d {branch-name}
git push origin --delete {branch-name}
Change branch
git checkout {branch-name}
First commit
git add .
git commit -m "initial commit"
Next commit
git add {file}
git commit -m "added file"
Cancel last commit
git reset --hard {commit}
git push --force
Update local
git pull
git pull origin {branch-name} # Specific
Send commits
git push
git push origin {branch-name} # Specific
Remove file from work dir
git rm {file}
Remove file from index
git rmg --cached {file}
git diff HEAD
git diff A B
git diff master..{branch} {path}
git log
git log -n {x}
git log --oneline -- {path}
git log --since=date --until=date
git log --oneline --graph --decorate
git log --oneline --graph --decorate {file}
git reset HEAD # Last
git reset HEAD -- {file} # Cancel file
git reset dsq1234 # Cancel with ID
git reset --hard HEAD^ # Cancel with Hard
- HEAD
- HEAD^
- HEAD^^
- HEAD~2
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/{user}/{depot}.git
git push -u origin main
git remote add origin https://github.com/{user}/{depot}.git
git branch -M main
git push -u origin main
- Jihad Sinnaour - Jakiboy (Initial work)
Please give it a Star if you like the project.